<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/pio.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('rp2__common_2hardware__pio_2include_2hardware_2pio_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">pio.h</div></div>
</div><!--header-->
<div class="contents">
<a href="rp2__common_2hardware__pio_2include_2hardware_2pio_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _HARDWARE_PIO_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _HARDWARE_PIO_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;<a class="code" href="address__mapped_8h.html">hardware/address_mapped.h</a>&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &quot;hardware/structs/pio.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &quot;<a class="code" href="gpio_8h.html">hardware/gpio.h</a>&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &quot;hardware/regs/dreq.h&quot;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &quot;hardware/pio_instructions.h&quot;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="comment">// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_PIO, Enable/disable assertions in the hardware_pio module, type=bool, default=0, group=hardware_pio</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_PIO</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#ifdef PARAM_ASSERTIONS_ENABLED_PIO </span><span class="comment">// backwards compatibility with SDK &lt; 2.0.0</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_PIO PARAM_ASSERTIONS_ENABLED_PIO</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_PIO 0</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="comment">// PICO_CONFIG: PICO_PIO_VERSION, The PIO hardware version, type=int, default=0 on RP2040 and 1 on RP2350, group=hardware_pio</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#ifndef PICO_PIO_VERSION</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#if PIO_GPIOBASE_BITS</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="preprocessor">#define PICO_PIO_VERSION 1</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="preprocessor">#define PICO_PIO_VERSION 0</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span><span class="keyword">static_assert</span>(PIO_SM0_SHIFTCTRL_FJOIN_RX_LSB == PIO_SM0_SHIFTCTRL_FJOIN_TX_LSB + 1, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga7d415b966abbc1c25315d0775d093356">   77</a></span><span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pio.html#ga7d415b966abbc1c25315d0775d093356">pio_fifo_join</a> {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a1ecaeaf5a3d81338a276b30f019b05c4">   78</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a1ecaeaf5a3d81338a276b30f019b05c4">PIO_FIFO_JOIN_NONE</a> = 0,    </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a22a2cbf467019804e134a38d40249f50">   79</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a22a2cbf467019804e134a38d40249f50">PIO_FIFO_JOIN_TX</a> = 1,      </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356ab2cff7409baac4928fec469fe5b44ed0">   80</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356ab2cff7409baac4928fec469fe5b44ed0">PIO_FIFO_JOIN_RX</a> = 2,      </div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>    PIO_FIFO_JOIN_TXGET = 4,   </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    PIO_FIFO_JOIN_TXPUT = 8,   </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>    PIO_FIFO_JOIN_PUTGET = 12, </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>};</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga356b3f4974cd31fdc4a2de381aceea5e">   91</a></span><span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pio.html#ga356b3f4974cd31fdc4a2de381aceea5e">pio_mov_status_type</a> {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>    STATUS_TX_LESSTHAN = 0,</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    STATUS_RX_LESSTHAN = 1,</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>    STATUS_IRQ_SET = 2</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>};</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span> </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span><span class="keyword">typedef</span> <a class="code hl_struct" href="structpio__hw__t.html">pio_hw_t</a> *<a class="code hl_struct" href="structpio__hw__t.html">PIO</a>;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga916d05e71da7f2173cd22b46bbfa0a11">  107</a></span><span class="preprocessor">#define pio0 pio0_hw</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga923a261ba19804c404900228e99c9522">  115</a></span><span class="preprocessor">#define pio1 pio1_hw</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span> </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span><span class="preprocessor">#if NUM_PIOS &gt; 2</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span><span class="preprocessor">#define pio2 pio2_hw</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span><span class="preprocessor">#ifndef PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span><span class="comment">// PICO_CONFIG: PICO_PIO_USE_GPIO_BASE, Enable code for handling more than 32 PIO pins, type=bool, default=true when supported and when the device has more than 32 pins, group=hardware_pio</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span><span class="preprocessor">#define PICO_PIO_USE_GPIO_BASE ((NUM_BANK0_GPIOS) &gt; 32)</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span> </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span><span class="preprocessor">#ifndef PIO_NUM</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span><span class="keyword">static_assert</span>(PIO1_BASE - PIO0_BASE == (1u &lt;&lt; 20), <span class="stringliteral">&quot;hardware layout mismatch&quot;</span>);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga79fcbff988c01df8285f05ce6ad3a86d">  144</a></span><span class="preprocessor">#define PIO_NUM(pio) (((uintptr_t)(pio) - PIO0_BASE) &gt;&gt; 20)</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span> </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span><span class="preprocessor">#ifndef PIO_INSTANCE</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span><span class="keyword">static_assert</span>(PIO1_BASE - PIO0_BASE == (1u &lt;&lt; 20), <span class="stringliteral">&quot;hardware layout mismatch&quot;</span>);</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga06134c14db82b7927d96faeb07ab0e8b">  157</a></span><span class="preprocessor">#define PIO_INSTANCE(instance) ((pio_hw_t *)(PIO0_BASE + (instance) * (1u &lt;&lt; 20)))</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span><span class="preprocessor">#ifndef PIO_FUNCSEL_NUM</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaa26de7b3ef34fb86138bf376ab152577">  169</a></span><span class="preprocessor">#define PIO_FUNCSEL_NUM(pio, gpio) ((gpio_function_t) (GPIO_FUNC_PIO0 + PIO_NUM(pio)))</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span> </div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span><span class="preprocessor">#ifndef PIO_DREQ_NUM</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ac5fedec084064e1d9ff9c6a382c1ccf8">DREQ_PIO0_TX1</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ad7529b7e45af2d7eab4b740ff15b49d8">DREQ_PIO0_TX0</a> + 1, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014aa2e360dbf123d634d08e5fae27aa29e5">DREQ_PIO0_TX2</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ad7529b7e45af2d7eab4b740ff15b49d8">DREQ_PIO0_TX0</a> + 2, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a156b1b999c6b2dd877545c8c79060a30">DREQ_PIO0_TX3</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ad7529b7e45af2d7eab4b740ff15b49d8">DREQ_PIO0_TX0</a> + 3, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ac4bc12d74b758a7b39c1977c401e2fe1">DREQ_PIO0_RX0</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ad7529b7e45af2d7eab4b740ff15b49d8">DREQ_PIO0_TX0</a> + NUM_PIO_STATE_MACHINES, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a833bfa99e8b74de9bfc1872958a742e3">DREQ_PIO1_RX0</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a3c22f2c9eb4a49654bba70dbc99bc893">DREQ_PIO1_TX0</a> + NUM_PIO_STATE_MACHINES, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gab9eca729acb2cebdb1abb7793d0f5bdf">  187</a></span><span class="preprocessor">#define PIO_DREQ_NUM(pio, sm, is_tx) ((sm) + (((is_tx) ? 0 : NUM_PIO_STATE_MACHINES) + PIO_NUM(pio) * (DREQ_PIO1_TX0 - DREQ_PIO0_TX0)))</span></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span> </div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span><span class="preprocessor">#ifndef PIO_IRQ_NUM</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaeb939c4541517980acf9de3ae4010624">  199</a></span><span class="preprocessor">#define PIO_IRQ_NUM(pio, irqn) (PIO0_IRQ_0 + NUM_PIO_IRQS * PIO_NUM(pio) + (irqn))</span></div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span> </div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"><a class="line" href="structpio__sm__config.html">  217</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>    uint32_t clkdiv;</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>    uint32_t execctrl;</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>    uint32_t shiftctrl;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>    uint32_t pinctrl;</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span><span class="preprocessor">#define PINHI_ALL_PINCTRL_LSBS ((1u &lt;&lt; PIO_SM0_PINCTRL_IN_BASE_LSB) | (1u &lt;&lt; PIO_SM0_PINCTRL_OUT_BASE_LSB) | \</span></div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span><span class="preprocessor">                               (1u &lt;&lt; PIO_SM0_PINCTRL_SET_BASE_LSB) | (1u &lt;&lt; PIO_SM0_PINCTRL_SIDESET_BASE_LSB))</span></div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span><span class="keyword">static_assert</span>( 0 == (0xff000000u &amp; (PINHI_ALL_PINCTRL_LSBS * 0x1f)), <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span><span class="comment">// note we put the jmp_ctrl pin starting at bit 24</span></div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span><span class="preprocessor">#define PINHI_ALL_PIN_LSBS ((1u &lt;&lt; 24) | (1u &lt;&lt; PIO_SM0_PINCTRL_IN_BASE_LSB) | (1u &lt;&lt; PIO_SM0_PINCTRL_OUT_BASE_LSB) | \</span></div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span><span class="preprocessor">                               (1u &lt;&lt; PIO_SM0_PINCTRL_SET_BASE_LSB) | (1u &lt;&lt; PIO_SM0_PINCTRL_SIDESET_BASE_LSB))</span></div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span>    <span class="comment">// each 5-bit field which would usually be used for the pin_base in pin_ctrl, is used for:</span></div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>    <span class="comment">// 0b11111 - corresponding field not specified</span></div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>    <span class="comment">// 0b00000 - pin is in range 0-15</span></div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>    <span class="comment">// 0b00001 - pin is in range 16-31</span></div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>    <span class="comment">// 0b00010 - pin is in range 32-47</span></div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span>    uint32_t pinhi;</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>} <a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a>;</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span> </div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> check_sm_param(__unused uint sm) {</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>    valid_params_if(HARDWARE_PIO, sm &lt; NUM_PIO_STATE_MACHINES);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>}</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span> </div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> check_sm_mask(__unused uint mask) {</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span>    valid_params_if(HARDWARE_PIO, mask &lt; (1u &lt;&lt; NUM_PIO_STATE_MACHINES));</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span>}</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span> </div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> check_pio_param(__unused <a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio) {</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span><span class="preprocessor">#if NUM_PIOS == 2</span></div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span>    valid_params_if(HARDWARE_PIO, pio == <a class="code hl_define" href="group__hardware__pio.html#ga916d05e71da7f2173cd22b46bbfa0a11">pio0</a> || pio == <a class="code hl_define" href="group__hardware__pio.html#ga923a261ba19804c404900228e99c9522">pio1</a>);</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno">  249</span><span class="preprocessor">#elif NUM_PIOS == 3</span></div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span>    valid_params_if(HARDWARE_PIO, pio == <a class="code hl_define" href="group__hardware__pio.html#ga916d05e71da7f2173cd22b46bbfa0a11">pio0</a> || pio == <a class="code hl_define" href="group__hardware__pio.html#ga923a261ba19804c404900228e99c9522">pio1</a> || pio == pio2);</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>}</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span> </div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> check_pio_pin_param(__unused uint pin) {</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span><span class="preprocessor">#if !PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>    invalid_params_if(HARDWARE_PIO, pin &gt;= 32);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>    <span class="comment">// pin base allows us to move up 16 pins at a time</span></div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span>    invalid_params_if(HARDWARE_PIO, pin &gt;= ((NUM_BANK0_GPIOS + 15u)&amp;~15u));</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span>}</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span> </div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"><a class="line" href="group__sm__config.html#ga1dbca28933c083592e6e359effe250bf">  271</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#ga1dbca28933c083592e6e359effe250bf">sm_config_set_out_pin_base</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint out_base) {</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>    check_pio_pin_param(out_base);</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>    c-&gt;pinctrl = (c-&gt;pinctrl &amp; ~PIO_SM0_PINCTRL_OUT_BASE_BITS) |</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span>                 ((out_base &amp; 31) &lt;&lt; PIO_SM0_PINCTRL_OUT_BASE_LSB);</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span>    c-&gt;pinhi = (c-&gt;pinhi &amp; ~(31u &lt;&lt; PIO_SM0_PINCTRL_OUT_BASE_LSB)) |</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>                    ((out_base &gt;&gt; 4) &lt;&lt; PIO_SM0_PINCTRL_OUT_BASE_LSB);</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno">  279</span>}</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno">  280</span> </div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"><a class="line" href="group__sm__config.html#gade3d072e319fc7d10bec180a9692ea89">  289</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gade3d072e319fc7d10bec180a9692ea89">sm_config_set_out_pin_count</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint out_count) {</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno">  290</span>    valid_params_if(HARDWARE_PIO, out_count &lt;= 32);</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno">  291</span>    c-&gt;pinctrl = (c-&gt;pinctrl &amp; ~PIO_SM0_PINCTRL_OUT_COUNT_BITS) |</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno">  292</span>                 (out_count &lt;&lt; PIO_SM0_PINCTRL_OUT_COUNT_LSB);</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span>}</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span> </div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"><a class="line" href="group__sm__config.html#gaf3004bbd996443d0c841664ebc92905c">  304</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gaf3004bbd996443d0c841664ebc92905c">sm_config_set_out_pins</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint out_base, uint out_count) {</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno">  305</span>    <a class="code hl_function" href="group__sm__config.html#ga1dbca28933c083592e6e359effe250bf">sm_config_set_out_pin_base</a>(c, out_base);</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno">  306</span>    <a class="code hl_function" href="group__sm__config.html#gade3d072e319fc7d10bec180a9692ea89">sm_config_set_out_pin_count</a>(c, out_count);</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno">  307</span>}</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno">  308</span> </div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"><a class="line" href="group__sm__config.html#ga40d4807c0665d30ceab153b7444560eb">  317</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#ga40d4807c0665d30ceab153b7444560eb">sm_config_set_set_pin_base</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint set_base) {</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span>    check_pio_pin_param(set_base);</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span>    c-&gt;pinctrl = (c-&gt;pinctrl &amp; ~PIO_SM0_PINCTRL_SET_BASE_BITS) |</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno">  320</span>                 ((set_base &amp; 31) &lt;&lt; PIO_SM0_PINCTRL_SET_BASE_LSB);</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno">  321</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span>    c-&gt;pinhi = (c-&gt;pinhi &amp; ~(31u &lt;&lt; PIO_SM0_PINCTRL_SET_BASE_LSB)) |</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno">  323</span>                    ((set_base &gt;&gt; 4) &lt;&lt; PIO_SM0_PINCTRL_SET_BASE_LSB);</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno">  324</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno">  325</span>}</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno">  326</span> </div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"><a class="line" href="group__sm__config.html#ga78e129fe383f2af0fc5e1448dea4c3d6">  335</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#ga78e129fe383f2af0fc5e1448dea4c3d6">sm_config_set_set_pin_count</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint set_count) {</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span>    valid_params_if(HARDWARE_PIO, set_count &lt;= 5);</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span>    c-&gt;pinctrl = (c-&gt;pinctrl &amp; ~PIO_SM0_PINCTRL_SET_COUNT_BITS) |</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno">  338</span>                 (set_count &lt;&lt; PIO_SM0_PINCTRL_SET_COUNT_LSB);</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno">  339</span>}</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno">  340</span> </div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"><a class="line" href="group__sm__config.html#gada1dff2c00b7d3a1cf722880c8373424">  350</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gada1dff2c00b7d3a1cf722880c8373424">sm_config_set_set_pins</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint set_base, uint set_count) {</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno">  351</span>    <a class="code hl_function" href="group__sm__config.html#ga40d4807c0665d30ceab153b7444560eb">sm_config_set_set_pin_base</a>(c, set_base);</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno">  352</span>    <a class="code hl_function" href="group__sm__config.html#ga78e129fe383f2af0fc5e1448dea4c3d6">sm_config_set_set_pin_count</a>(c, set_count);</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno">  353</span>}</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno">  354</span> </div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"><a class="line" href="group__sm__config.html#gaaf804a05a2ebaa127d0d216b3d4e3e80">  363</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gaaf804a05a2ebaa127d0d216b3d4e3e80">sm_config_set_in_pin_base</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint in_base) {</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno">  364</span>    check_pio_pin_param(in_base);</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno">  365</span>    c-&gt;pinctrl = (c-&gt;pinctrl &amp; ~PIO_SM0_PINCTRL_IN_BASE_BITS) |</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno">  366</span>                 ((in_base &amp; 31) &lt;&lt; PIO_SM0_PINCTRL_IN_BASE_LSB);</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno">  367</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span>    c-&gt;pinhi = (c-&gt;pinhi &amp; ~(31u &lt;&lt; PIO_SM0_PINCTRL_IN_BASE_LSB)) |</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno">  369</span>                    ((in_base &gt;&gt; 4) &lt;&lt; PIO_SM0_PINCTRL_IN_BASE_LSB);</div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno">  370</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno">  371</span>}</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno">  372</span> </div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"><a class="line" href="group__sm__config.html#gac418400e30520ea3961d8977c180a4f9">  381</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gac418400e30520ea3961d8977c180a4f9">sm_config_set_in_pins</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint in_base) {</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno">  382</span>    <a class="code hl_function" href="group__sm__config.html#gaaf804a05a2ebaa127d0d216b3d4e3e80">sm_config_set_in_pin_base</a>(c, in_base);</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno">  383</span>}</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno">  384</span> </div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno">  385</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> sm_config_set_in_pin_count(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint in_count) {</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno">  386</span><span class="preprocessor">#if PICO_PIO_VERSION == 0</span></div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno">  387</span>    <span class="comment">// can&#39;t be changed from 32 on PIO v0</span></div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno">  388</span>    ((void)c);</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno">  389</span>    valid_params_if(HARDWARE_PIO, in_count == 32);</div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno">  390</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno">  391</span>    valid_params_if(HARDWARE_PIO, in_count &amp;&amp; in_count &lt;= 32);</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno">  392</span>    c-&gt;shiftctrl = (c-&gt;shiftctrl &amp; ~PIO_SM0_SHIFTCTRL_IN_COUNT_BITS) |</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span>                   ((in_count - 1) &lt;&lt; PIO_SM0_SHIFTCTRL_IN_COUNT_LSB);</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno">  394</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno">  395</span>}</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno">  396</span> </div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"><a class="line" href="group__sm__config.html#ga7abfda1f60c62565d5b13536b0605af7">  405</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#ga7abfda1f60c62565d5b13536b0605af7">sm_config_set_sideset_pin_base</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint sideset_base) {</div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno">  406</span>    check_pio_pin_param(sideset_base);</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno">  407</span>    c-&gt;pinctrl = (c-&gt;pinctrl &amp; ~PIO_SM0_PINCTRL_SIDESET_BASE_BITS) |</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno">  408</span>                 ((sideset_base &amp; 31) &lt;&lt; PIO_SM0_PINCTRL_SIDESET_BASE_LSB);</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno">  409</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno">  410</span>    c-&gt;pinhi = (c-&gt;pinhi &amp; ~(31u &lt;&lt; PIO_SM0_PINCTRL_SIDESET_BASE_LSB)) |</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno">  411</span>                    ((sideset_base &gt;&gt; 4) &lt;&lt; PIO_SM0_PINCTRL_SIDESET_BASE_LSB);</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno">  412</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno">  413</span>}</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno">  414</span> </div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"><a class="line" href="group__sm__config.html#gad55bf8b410fa1d13bd1bd020587e01d7">  426</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gad55bf8b410fa1d13bd1bd020587e01d7">sm_config_set_sideset_pins</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint sideset_base) {</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno">  427</span>    <a class="code hl_function" href="group__sm__config.html#ga7abfda1f60c62565d5b13536b0605af7">sm_config_set_sideset_pin_base</a>(c, sideset_base);</div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno">  428</span>}</div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno">  429</span> </div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"><a class="line" href="group__sm__config.html#gaf543422206a8dbdc2efea85818dd650e">  438</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gaf543422206a8dbdc2efea85818dd650e">sm_config_set_sideset</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint bit_count, <span class="keywordtype">bool</span> optional, <span class="keywordtype">bool</span> pindirs) {</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno">  439</span>    valid_params_if(HARDWARE_PIO, bit_count &lt;= 5);</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno">  440</span>    valid_params_if(HARDWARE_PIO, !optional || bit_count &gt;= 1);</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno">  441</span>    c-&gt;pinctrl = (c-&gt;pinctrl &amp; ~PIO_SM0_PINCTRL_SIDESET_COUNT_BITS) |</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno">  442</span>                 (bit_count &lt;&lt; PIO_SM0_PINCTRL_SIDESET_COUNT_LSB);</div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno">  443</span>    c-&gt;execctrl = (c-&gt;execctrl &amp; ~(PIO_SM0_EXECCTRL_SIDE_EN_BITS | PIO_SM0_EXECCTRL_SIDE_PINDIR_BITS)) |</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno">  444</span>                  (bool_to_bit(optional) &lt;&lt; PIO_SM0_EXECCTRL_SIDE_EN_LSB) |</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno">  445</span>                  (bool_to_bit(pindirs) &lt;&lt; PIO_SM0_EXECCTRL_SIDE_PINDIR_LSB);</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno">  446</span>}</div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno">  447</span> </div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"><a class="line" href="group__sm__config.html#ga365abc6d25301810ca5ee11e5b36c763">  461</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#ga365abc6d25301810ca5ee11e5b36c763">sm_config_set_clkdiv_int_frac</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint16_t div_int, uint8_t div_frac) {</div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno">  462</span>    invalid_params_if(HARDWARE_PIO, div_int == 0 &amp;&amp; div_frac != 0);</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno">  463</span>    c-&gt;clkdiv =</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span>            (((uint)div_frac) &lt;&lt; PIO_SM0_CLKDIV_FRAC_LSB) |</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span>            (((uint)div_int) &lt;&lt; PIO_SM0_CLKDIV_INT_LSB);</div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno">  466</span>}</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno">  467</span> </div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno">  468</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> pio_calculate_clkdiv_from_float(<span class="keywordtype">float</span> div, uint16_t *div_int, uint8_t *div_frac) {</div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno">  469</span>    valid_params_if(HARDWARE_PIO, div &gt;= 1 &amp;&amp; div &lt;= 65536);</div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno">  470</span>    *div_int = (uint16_t)div;</div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno">  471</span>    <span class="keywordflow">if</span> (*div_int == 0) {</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno">  472</span>        *div_frac = 0;</div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno">  473</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno">  474</span>        *div_frac = (uint8_t)((div - (<span class="keywordtype">float</span>)*div_int) * (1u &lt;&lt; 8u));</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno">  475</span>    }</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno">  476</span>}</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno">  477</span> </div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"><a class="line" href="group__sm__config.html#gae8c09c7a4372da95ad777faae51c5a24">  493</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gae8c09c7a4372da95ad777faae51c5a24">sm_config_set_clkdiv</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, <span class="keywordtype">float</span> div) {</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno">  494</span>    uint16_t div_int;</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno">  495</span>    uint8_t div_frac;</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span>    pio_calculate_clkdiv_from_float(div, &amp;div_int, &amp;div_frac);</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno">  497</span>    <a class="code hl_function" href="group__sm__config.html#ga365abc6d25301810ca5ee11e5b36c763">sm_config_set_clkdiv_int_frac</a>(c, div_int, div_frac);</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span>}</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno">  499</span> </div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno"><a class="line" href="group__sm__config.html#gafb753e8b35bbea9209ca4399a845f89c">  508</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gafb753e8b35bbea9209ca4399a845f89c">sm_config_set_wrap</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint wrap_target, uint wrap) {</div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno">  509</span>    valid_params_if(HARDWARE_PIO, wrap &lt; PIO_INSTRUCTION_COUNT);</div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno">  510</span>    valid_params_if(HARDWARE_PIO, wrap_target &lt; PIO_INSTRUCTION_COUNT);</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno">  511</span>    c-&gt;execctrl = (c-&gt;execctrl &amp; ~(PIO_SM0_EXECCTRL_WRAP_TOP_BITS | PIO_SM0_EXECCTRL_WRAP_BOTTOM_BITS)) |</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno">  512</span>                  (wrap_target &lt;&lt; PIO_SM0_EXECCTRL_WRAP_BOTTOM_LSB) |</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno">  513</span>                  (wrap &lt;&lt; PIO_SM0_EXECCTRL_WRAP_TOP_LSB);</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno">  514</span>}</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno">  515</span> </div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno"><a class="line" href="group__sm__config.html#gaf2bfc66d6427ff92519e38dcb611133b">  522</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gaf2bfc66d6427ff92519e38dcb611133b">sm_config_set_jmp_pin</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, uint pin) {</div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno">  523</span>    check_pio_pin_param(pin);</div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno">  524</span>    c-&gt;execctrl = (c-&gt;execctrl &amp; ~PIO_SM0_EXECCTRL_JMP_PIN_BITS) |</div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno">  525</span>                  ((pin &amp; 31) &lt;&lt; PIO_SM0_EXECCTRL_JMP_PIN_LSB);</div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno">  526</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno">  527</span>    c-&gt;pinhi = (c-&gt;pinhi &amp; ~(31u &lt;&lt; 24)) |</div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno">  528</span>               ((pin &gt;&gt; 4) &lt;&lt; 24);</div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno">  529</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno">  530</span>}</div>
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno">  531</span> </div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno"><a class="line" href="group__sm__config.html#gaed7a6e7dc4f1979c7c62e4773df8c79b">  540</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gaed7a6e7dc4f1979c7c62e4773df8c79b">sm_config_set_in_shift</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, <span class="keywordtype">bool</span> shift_right, <span class="keywordtype">bool</span> autopush, uint push_threshold) {</div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno">  541</span>    valid_params_if(HARDWARE_PIO, push_threshold &lt;= 32);</div>
<div class="line"><a id="l00542" name="l00542"></a><span class="lineno">  542</span>    c-&gt;shiftctrl = (c-&gt;shiftctrl &amp;</div>
<div class="line"><a id="l00543" name="l00543"></a><span class="lineno">  543</span>                    ~(PIO_SM0_SHIFTCTRL_IN_SHIFTDIR_BITS |</div>
<div class="line"><a id="l00544" name="l00544"></a><span class="lineno">  544</span>                      PIO_SM0_SHIFTCTRL_AUTOPUSH_BITS |</div>
<div class="line"><a id="l00545" name="l00545"></a><span class="lineno">  545</span>                      PIO_SM0_SHIFTCTRL_PUSH_THRESH_BITS)) |</div>
<div class="line"><a id="l00546" name="l00546"></a><span class="lineno">  546</span>                   (bool_to_bit(shift_right) &lt;&lt; PIO_SM0_SHIFTCTRL_IN_SHIFTDIR_LSB) |</div>
<div class="line"><a id="l00547" name="l00547"></a><span class="lineno">  547</span>                   (bool_to_bit(autopush) &lt;&lt; PIO_SM0_SHIFTCTRL_AUTOPUSH_LSB) |</div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno">  548</span>                   ((push_threshold &amp; 0x1fu) &lt;&lt; PIO_SM0_SHIFTCTRL_PUSH_THRESH_LSB);</div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno">  549</span>}</div>
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno">  550</span> </div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno"><a class="line" href="group__sm__config.html#ga613bed03e10e569f1b7aede74d40a5b5">  559</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#ga613bed03e10e569f1b7aede74d40a5b5">sm_config_set_out_shift</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, <span class="keywordtype">bool</span> shift_right, <span class="keywordtype">bool</span> autopull, uint pull_threshold) {</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno">  560</span>    valid_params_if(HARDWARE_PIO, pull_threshold &lt;= 32);</div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno">  561</span>    c-&gt;shiftctrl = (c-&gt;shiftctrl &amp;</div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno">  562</span>                    ~(PIO_SM0_SHIFTCTRL_OUT_SHIFTDIR_BITS |</div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno">  563</span>                      PIO_SM0_SHIFTCTRL_AUTOPULL_BITS |</div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno">  564</span>                      PIO_SM0_SHIFTCTRL_PULL_THRESH_BITS)) |</div>
<div class="line"><a id="l00565" name="l00565"></a><span class="lineno">  565</span>                   (bool_to_bit(shift_right) &lt;&lt; PIO_SM0_SHIFTCTRL_OUT_SHIFTDIR_LSB) |</div>
<div class="line"><a id="l00566" name="l00566"></a><span class="lineno">  566</span>                   (bool_to_bit(autopull) &lt;&lt; PIO_SM0_SHIFTCTRL_AUTOPULL_LSB) |</div>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno">  567</span>                   ((pull_threshold &amp; 0x1fu) &lt;&lt; PIO_SM0_SHIFTCTRL_PULL_THRESH_LSB);</div>
<div class="line"><a id="l00568" name="l00568"></a><span class="lineno">  568</span>}</div>
<div class="line"><a id="l00569" name="l00569"></a><span class="lineno">  569</span> </div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno"><a class="line" href="group__sm__config.html#gafea1a06362182514518ebd91b2d52fd5">  576</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gafea1a06362182514518ebd91b2d52fd5">sm_config_set_fifo_join</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, <span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pio.html#ga7d415b966abbc1c25315d0775d093356">pio_fifo_join</a> join) {</div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno">  577</span>    valid_params_if(HARDWARE_PIO, join == <a class="code hl_enumvalue" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a1ecaeaf5a3d81338a276b30f019b05c4">PIO_FIFO_JOIN_NONE</a> || join == <a class="code hl_enumvalue" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a22a2cbf467019804e134a38d40249f50">PIO_FIFO_JOIN_TX</a> || join == <a class="code hl_enumvalue" href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356ab2cff7409baac4928fec469fe5b44ed0">PIO_FIFO_JOIN_RX</a></div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno">  578</span>#<span class="keywordflow">if</span> PICO_PIO_VERSION &gt; 0</div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno">  579</span>        || join == PIO_FIFO_JOIN_TXPUT || join == PIO_FIFO_JOIN_TXGET || join == PIO_FIFO_JOIN_PUTGET</div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno">  580</span>#endif</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno">  581</span>    );</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno">  582</span><span class="preprocessor">#if PICO_PIO_VERSION == 0</span></div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno">  583</span>    c-&gt;shiftctrl = (c-&gt;shiftctrl &amp; (uint)~(PIO_SM0_SHIFTCTRL_FJOIN_TX_BITS | PIO_SM0_SHIFTCTRL_FJOIN_RX_BITS)) |</div>
<div class="line"><a id="l00584" name="l00584"></a><span class="lineno">  584</span>                   (((uint)join) &lt;&lt; PIO_SM0_SHIFTCTRL_FJOIN_TX_LSB);</div>
<div class="line"><a id="l00585" name="l00585"></a><span class="lineno">  585</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00586" name="l00586"></a><span class="lineno">  586</span>    c-&gt;shiftctrl = (c-&gt;shiftctrl &amp; (uint)~(PIO_SM0_SHIFTCTRL_FJOIN_TX_BITS | PIO_SM0_SHIFTCTRL_FJOIN_RX_BITS |</div>
<div class="line"><a id="l00587" name="l00587"></a><span class="lineno">  587</span>                                           PIO_SM0_SHIFTCTRL_FJOIN_RX_PUT_BITS | PIO_SM0_SHIFTCTRL_FJOIN_RX_GET_BITS)) |</div>
<div class="line"><a id="l00588" name="l00588"></a><span class="lineno">  588</span>                   (((uint)(join &amp; 3)) &lt;&lt; PIO_SM0_SHIFTCTRL_FJOIN_TX_LSB) |</div>
<div class="line"><a id="l00589" name="l00589"></a><span class="lineno">  589</span>                   (((uint)(join &gt;&gt; 2)) &lt;&lt; PIO_SM0_SHIFTCTRL_FJOIN_RX_GET_LSB);</div>
<div class="line"><a id="l00590" name="l00590"></a><span class="lineno">  590</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00591" name="l00591"></a><span class="lineno">  591</span>}</div>
<div class="line"><a id="l00592" name="l00592"></a><span class="lineno">  592</span> </div>
<div class="line"><a id="l00601" name="l00601"></a><span class="lineno"><a class="line" href="group__sm__config.html#ga8a9141ceadf9e735b1e96457865de3f6">  601</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#ga8a9141ceadf9e735b1e96457865de3f6">sm_config_set_out_special</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, <span class="keywordtype">bool</span> sticky, <span class="keywordtype">bool</span> has_enable_pin, uint enable_pin_index) {</div>
<div class="line"><a id="l00602" name="l00602"></a><span class="lineno">  602</span>    c-&gt;execctrl = (c-&gt;execctrl &amp;</div>
<div class="line"><a id="l00603" name="l00603"></a><span class="lineno">  603</span>                   (uint)~(PIO_SM0_EXECCTRL_OUT_STICKY_BITS | PIO_SM0_EXECCTRL_INLINE_OUT_EN_BITS |</div>
<div class="line"><a id="l00604" name="l00604"></a><span class="lineno">  604</span>                     PIO_SM0_EXECCTRL_OUT_EN_SEL_BITS)) |</div>
<div class="line"><a id="l00605" name="l00605"></a><span class="lineno">  605</span>                  (bool_to_bit(sticky) &lt;&lt; PIO_SM0_EXECCTRL_OUT_STICKY_LSB) |</div>
<div class="line"><a id="l00606" name="l00606"></a><span class="lineno">  606</span>                  (bool_to_bit(has_enable_pin) &lt;&lt; PIO_SM0_EXECCTRL_INLINE_OUT_EN_LSB) |</div>
<div class="line"><a id="l00607" name="l00607"></a><span class="lineno">  607</span>                  ((enable_pin_index &lt;&lt; PIO_SM0_EXECCTRL_OUT_EN_SEL_LSB) &amp; PIO_SM0_EXECCTRL_OUT_EN_SEL_BITS);</div>
<div class="line"><a id="l00608" name="l00608"></a><span class="lineno">  608</span>}</div>
<div class="line"><a id="l00609" name="l00609"></a><span class="lineno">  609</span> </div>
<div class="line"><a id="l00617" name="l00617"></a><span class="lineno"><a class="line" href="group__sm__config.html#gacd24870944ce2f00f3f7847bb3e5d543">  617</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__sm__config.html#gacd24870944ce2f00f3f7847bb3e5d543">sm_config_set_mov_status</a>(<a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *c, <span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pio.html#ga356b3f4974cd31fdc4a2de381aceea5e">pio_mov_status_type</a> status_sel, uint status_n) {</div>
<div class="line"><a id="l00618" name="l00618"></a><span class="lineno">  618</span>    valid_params_if(HARDWARE_PIO,</div>
<div class="line"><a id="l00619" name="l00619"></a><span class="lineno">  619</span>                    status_sel == STATUS_TX_LESSTHAN || status_sel == STATUS_RX_LESSTHAN</div>
<div class="line"><a id="l00620" name="l00620"></a><span class="lineno">  620</span>#<span class="keywordflow">if</span> PICO_PIO_VERSION &gt; 0</div>
<div class="line"><a id="l00621" name="l00621"></a><span class="lineno">  621</span>                    || status_sel == STATUS_IRQ_SET</div>
<div class="line"><a id="l00622" name="l00622"></a><span class="lineno">  622</span>#endif</div>
<div class="line"><a id="l00623" name="l00623"></a><span class="lineno">  623</span>    );</div>
<div class="line"><a id="l00624" name="l00624"></a><span class="lineno">  624</span>    c-&gt;execctrl = (c-&gt;execctrl</div>
<div class="line"><a id="l00625" name="l00625"></a><span class="lineno">  625</span>                  &amp; ~(PIO_SM0_EXECCTRL_STATUS_SEL_BITS | PIO_SM0_EXECCTRL_STATUS_N_BITS))</div>
<div class="line"><a id="l00626" name="l00626"></a><span class="lineno">  626</span>                  | ((((uint)status_sel) &lt;&lt; PIO_SM0_EXECCTRL_STATUS_SEL_LSB) &amp; PIO_SM0_EXECCTRL_STATUS_SEL_BITS)</div>
<div class="line"><a id="l00627" name="l00627"></a><span class="lineno">  627</span>                  | ((status_n &lt;&lt; PIO_SM0_EXECCTRL_STATUS_N_LSB) &amp; PIO_SM0_EXECCTRL_STATUS_N_BITS);</div>
<div class="line"><a id="l00628" name="l00628"></a><span class="lineno">  628</span>}</div>
<div class="line"><a id="l00629" name="l00629"></a><span class="lineno">  629</span> </div>
<div class="line"><a id="l00649" name="l00649"></a><span class="lineno"><a class="line" href="group__sm__config.html#gaf2d2a23b08ba74188160469b3fd09936">  649</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> <a class="code hl_function" href="group__sm__config.html#gaf2d2a23b08ba74188160469b3fd09936">pio_get_default_sm_config</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00650" name="l00650"></a><span class="lineno">  650</span>    <a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> c = {0};</div>
<div class="line"><a id="l00651" name="l00651"></a><span class="lineno">  651</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00652" name="l00652"></a><span class="lineno">  652</span>    c.pinhi = -1;</div>
<div class="line"><a id="l00653" name="l00653"></a><span class="lineno">  653</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00654" name="l00654"></a><span class="lineno">  654</span>    <a class="code hl_function" href="group__sm__config.html#ga365abc6d25301810ca5ee11e5b36c763">sm_config_set_clkdiv_int_frac</a>(&amp;c, 1, 0);</div>
<div class="line"><a id="l00655" name="l00655"></a><span class="lineno">  655</span>    <a class="code hl_function" href="group__sm__config.html#gafb753e8b35bbea9209ca4399a845f89c">sm_config_set_wrap</a>(&amp;c, 0, 31);</div>
<div class="line"><a id="l00656" name="l00656"></a><span class="lineno">  656</span>    <a class="code hl_function" href="group__sm__config.html#gaed7a6e7dc4f1979c7c62e4773df8c79b">sm_config_set_in_shift</a>(&amp;c, <span class="keyword">true</span>, <span class="keyword">false</span>, 32);</div>
<div class="line"><a id="l00657" name="l00657"></a><span class="lineno">  657</span>    <a class="code hl_function" href="group__sm__config.html#ga613bed03e10e569f1b7aede74d40a5b5">sm_config_set_out_shift</a>(&amp;c, <span class="keyword">true</span>, <span class="keyword">false</span>, 32);</div>
<div class="line"><a id="l00658" name="l00658"></a><span class="lineno">  658</span>    <span class="keywordflow">return</span> c;</div>
<div class="line"><a id="l00659" name="l00659"></a><span class="lineno">  659</span>}</div>
<div class="line"><a id="l00660" name="l00660"></a><span class="lineno">  660</span> </div>
<div class="line"><a id="l00671" name="l00671"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">  671</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio) {</div>
<div class="line"><a id="l00672" name="l00672"></a><span class="lineno">  672</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l00673" name="l00673"></a><span class="lineno">  673</span>    <span class="keywordflow">return</span> pio-&gt;gpiobase;</div>
<div class="line"><a id="l00674" name="l00674"></a><span class="lineno">  674</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00675" name="l00675"></a><span class="lineno">  675</span>    ((void)pio);</div>
<div class="line"><a id="l00676" name="l00676"></a><span class="lineno">  676</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00677" name="l00677"></a><span class="lineno">  677</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00678" name="l00678"></a><span class="lineno">  678</span>}</div>
<div class="line"><a id="l00679" name="l00679"></a><span class="lineno">  679</span> </div>
<div class="line"><a id="l00688" name="l00688"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga28e9a84f3332ebf088f665d4b676117b">  688</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__pio.html#ga28e9a84f3332ebf088f665d4b676117b">pio_sm_set_config</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, <span class="keyword">const</span> <a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *config) {</div>
<div class="line"><a id="l00689" name="l00689"></a><span class="lineno">  689</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00690" name="l00690"></a><span class="lineno">  690</span>    check_sm_param(sm);</div>
<div class="line"><a id="l00691" name="l00691"></a><span class="lineno">  691</span>    pio-&gt;sm[sm].clkdiv = config-&gt;clkdiv;</div>
<div class="line"><a id="l00692" name="l00692"></a><span class="lineno">  692</span>    pio-&gt;sm[sm].execctrl = config-&gt;execctrl;</div>
<div class="line"><a id="l00693" name="l00693"></a><span class="lineno">  693</span>    pio-&gt;sm[sm].shiftctrl = config-&gt;shiftctrl;</div>
<div class="line"><a id="l00694" name="l00694"></a><span class="lineno">  694</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l00695" name="l00695"></a><span class="lineno">  695</span>    uint used = (~config-&gt;pinhi &gt;&gt; 4) &amp; PINHI_ALL_PIN_LSBS;</div>
<div class="line"><a id="l00696" name="l00696"></a><span class="lineno">  696</span>    <span class="comment">// configs that use pins 0-15</span></div>
<div class="line"><a id="l00697" name="l00697"></a><span class="lineno">  697</span>    uint gpio_under_16 = (~config-&gt;pinhi) &amp; (~config-&gt;pinhi &gt;&gt; 1) &amp; used;</div>
<div class="line"><a id="l00698" name="l00698"></a><span class="lineno">  698</span>    <span class="comment">// configs that use pins 32-47</span></div>
<div class="line"><a id="l00699" name="l00699"></a><span class="lineno">  699</span>    uint gpio_over_32 = (config-&gt;pinhi &gt;&gt; 1) &amp; used;</div>
<div class="line"><a id="l00700" name="l00700"></a><span class="lineno">  700</span>    uint gpio_base = <a class="code hl_function" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a>(pio);</div>
<div class="line"><a id="l00701" name="l00701"></a><span class="lineno">  701</span>    invalid_params_if_and_return(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a>, gpio_under_16 &amp;&amp; gpio_base, <a class="code hl_enumvalue" href="group__pico__base.html#ggaddcb20bc9a61ceff479aa87369a862aaac86a6335326022a1ff4d1cd8aad4bb69">PICO_ERROR_BAD_ALIGNMENT</a>);</div>
<div class="line"><a id="l00702" name="l00702"></a><span class="lineno">  702</span>    invalid_params_if_and_return(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a>, gpio_over_32 &amp;&amp; !gpio_base, <a class="code hl_enumvalue" href="group__pico__base.html#ggaddcb20bc9a61ceff479aa87369a862aaac86a6335326022a1ff4d1cd8aad4bb69">PICO_ERROR_BAD_ALIGNMENT</a>);</div>
<div class="line"><a id="l00703" name="l00703"></a><span class="lineno">  703</span>    <span class="comment">// flip the top bit of any used (pinctrl) values to turn:</span></div>
<div class="line"><a id="l00704" name="l00704"></a><span class="lineno">  704</span>    <span class="comment">// bit6(32) + 0-15  -&gt; base(16) + 16-31</span></div>
<div class="line"><a id="l00705" name="l00705"></a><span class="lineno">  705</span>    <span class="comment">// bit6(0)  + 16-31 -&gt; base(16) + 0-15</span></div>
<div class="line"><a id="l00706" name="l00706"></a><span class="lineno">  706</span>    pio-&gt;sm[sm].pinctrl = config-&gt;pinctrl ^ (gpio_base ? ((used &lt;&lt; 12) &gt;&gt; 8) : 0);</div>
<div class="line"><a id="l00707" name="l00707"></a><span class="lineno">  707</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00708" name="l00708"></a><span class="lineno">  708</span>    pio-&gt;sm[sm].pinctrl = config-&gt;pinctrl;</div>
<div class="line"><a id="l00709" name="l00709"></a><span class="lineno">  709</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00710" name="l00710"></a><span class="lineno">  710</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="group__pico__base.html#ggaddcb20bc9a61ceff479aa87369a862aaa9b50bcb755cf2e8295de9ffa52b252fd">PICO_OK</a>;</div>
<div class="line"><a id="l00711" name="l00711"></a><span class="lineno">  711</span>}</div>
<div class="line"><a id="l00712" name="l00712"></a><span class="lineno">  712</span> </div>
<div class="line"><a id="l00719" name="l00719"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gae86f691914b78d66b1394ae94f3f4aa6">  719</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pio.html#gae86f691914b78d66b1394ae94f3f4aa6">pio_get_index</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio) {</div>
<div class="line"><a id="l00720" name="l00720"></a><span class="lineno">  720</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00721" name="l00721"></a><span class="lineno">  721</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__pio.html#ga79fcbff988c01df8285f05ce6ad3a86d">PIO_NUM</a>(pio);</div>
<div class="line"><a id="l00722" name="l00722"></a><span class="lineno">  722</span>}</div>
<div class="line"><a id="l00723" name="l00723"></a><span class="lineno">  723</span> </div>
<div class="line"><a id="l00731" name="l00731"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga9e150bfd3d43565a01f38a37fa2884d4">  731</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pio.html#ga9e150bfd3d43565a01f38a37fa2884d4">pio_get_funcsel</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio) {</div>
<div class="line"><a id="l00732" name="l00732"></a><span class="lineno">  732</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00733" name="l00733"></a><span class="lineno">  733</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__pio.html#gaa26de7b3ef34fb86138bf376ab152577">PIO_FUNCSEL_NUM</a>(pio, 0); <span class="comment">// note GPIO currently unused, so won&#39;t bother updating API</span></div>
<div class="line"><a id="l00734" name="l00734"></a><span class="lineno">  734</span>}</div>
<div class="line"><a id="l00735" name="l00735"></a><span class="lineno">  735</span> </div>
<div class="line"><a id="l00742" name="l00742"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga151f87205041da11d3c69be5ddbd5653">  742</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_struct" href="structpio__hw__t.html">PIO</a> <a class="code hl_function" href="group__hardware__pio.html#ga151f87205041da11d3c69be5ddbd5653">pio_get_instance</a>(uint instance) {</div>
<div class="line"><a id="l00743" name="l00743"></a><span class="lineno">  743</span>    invalid_params_if(HARDWARE_PIO, instance &gt;= NUM_PIOS);</div>
<div class="line"><a id="l00744" name="l00744"></a><span class="lineno">  744</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__pio.html#ga06134c14db82b7927d96faeb07ab0e8b">PIO_INSTANCE</a>(instance);</div>
<div class="line"><a id="l00745" name="l00745"></a><span class="lineno">  745</span>}</div>
<div class="line"><a id="l00746" name="l00746"></a><span class="lineno">  746</span> </div>
<div class="line"><a id="l00759" name="l00759"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gafa244b1be8f53a329db9d26298e054bb">  759</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gafa244b1be8f53a329db9d26298e054bb">pio_gpio_init</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint pin) {</div>
<div class="line"><a id="l00760" name="l00760"></a><span class="lineno">  760</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00761" name="l00761"></a><span class="lineno">  761</span>    valid_params_if(HARDWARE_PIO, pin &lt; NUM_BANK0_GPIOS);</div>
<div class="line"><a id="l00762" name="l00762"></a><span class="lineno">  762</span>    <a class="code hl_function" href="group__hardware__gpio.html#ga22f6b90c4c7e0013b4b5341de0a44fc4">gpio_set_function</a>(pin, <a class="code hl_define" href="group__hardware__pio.html#gaa26de7b3ef34fb86138bf376ab152577">PIO_FUNCSEL_NUM</a>(pio, pin));</div>
<div class="line"><a id="l00763" name="l00763"></a><span class="lineno">  763</span>}</div>
<div class="line"><a id="l00764" name="l00764"></a><span class="lineno">  764</span> </div>
<div class="line"><a id="l00772" name="l00772"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga4091eef7afda5200a3988b9412fe3b3f">  772</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pio.html#ga4091eef7afda5200a3988b9412fe3b3f">pio_get_dreq</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, <span class="keywordtype">bool</span> is_tx) {</div>
<div class="line"><a id="l00773" name="l00773"></a><span class="lineno">  773</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00774" name="l00774"></a><span class="lineno">  774</span>    check_sm_param(sm);</div>
<div class="line"><a id="l00775" name="l00775"></a><span class="lineno">  775</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__pio.html#gab9eca729acb2cebdb1abb7793d0f5bdf">PIO_DREQ_NUM</a>(pio, sm, is_tx);</div>
<div class="line"><a id="l00776" name="l00776"></a><span class="lineno">  776</span>}</div>
<div class="line"><a id="l00777" name="l00777"></a><span class="lineno">  777</span> </div>
<div class="line"><a id="l00778" name="l00778"></a><span class="lineno"><a class="line" href="structpio__program.html">  778</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="structpio__program.html">pio_program</a> {</div>
<div class="line"><a id="l00779" name="l00779"></a><span class="lineno">  779</span>    <span class="keyword">const</span> uint16_t *instructions;</div>
<div class="line"><a id="l00780" name="l00780"></a><span class="lineno">  780</span>    uint8_t length;</div>
<div class="line"><a id="l00781" name="l00781"></a><span class="lineno">  781</span>    int8_t origin; <span class="comment">// required instruction memory origin or -1</span></div>
<div class="line"><a id="l00782" name="l00782"></a><span class="lineno">  782</span>    uint8_t pio_version;</div>
<div class="line"><a id="l00783" name="l00783"></a><span class="lineno">  783</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l00784" name="l00784"></a><span class="lineno">  784</span>    uint8_t used_gpio_ranges; <span class="comment">// bitmap with one bit per 16 pins</span></div>
<div class="line"><a id="l00785" name="l00785"></a><span class="lineno">  785</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00786" name="l00786"></a><span class="lineno">  786</span>} <a class="code hl_struct" href="structpio__program.html">pio_program_t</a>;</div>
<div class="line"><a id="l00787" name="l00787"></a><span class="lineno">  787</span> </div>
<div class="line"><a id="l00799" name="l00799"></a><span class="lineno">  799</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__pio.html#ga332210f0e594b24bf64f4bb1c8f49be3">pio_set_gpio_base</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint gpio_base);</div>
<div class="line"><a id="l00800" name="l00800"></a><span class="lineno">  800</span> </div>
<div class="line"><a id="l00808" name="l00808"></a><span class="lineno">  808</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#gaa8aafe966a46f4de9be59f73cae65a4b">pio_can_add_program</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program);</div>
<div class="line"><a id="l00809" name="l00809"></a><span class="lineno">  809</span> </div>
<div class="line"><a id="l00818" name="l00818"></a><span class="lineno">  818</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#gaafac789d94b0727bb02ea83a8786897f">pio_can_add_program_at_offset</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program, uint offset);</div>
<div class="line"><a id="l00819" name="l00819"></a><span class="lineno">  819</span> </div>
<div class="line"><a id="l00830" name="l00830"></a><span class="lineno">  830</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__pio.html#gaefbd086e8e96fee073438dac3c20334c">pio_add_program</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program);</div>
<div class="line"><a id="l00831" name="l00831"></a><span class="lineno">  831</span> </div>
<div class="line"><a id="l00843" name="l00843"></a><span class="lineno">  843</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__pio.html#ga12948478935f817218b64e1db3a8ebad">pio_add_program_at_offset</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program, uint offset);</div>
<div class="line"><a id="l00844" name="l00844"></a><span class="lineno">  844</span> </div>
<div class="line"><a id="l00852" name="l00852"></a><span class="lineno">  852</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga81c77d31aff72655977b658a9c37665e">pio_remove_program</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program, uint loaded_offset);</div>
<div class="line"><a id="l00853" name="l00853"></a><span class="lineno">  853</span> </div>
<div class="line"><a id="l00859" name="l00859"></a><span class="lineno">  859</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga850396a2a2925bbcc97247a629ca5bd2">pio_clear_instruction_memory</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio);</div>
<div class="line"><a id="l00860" name="l00860"></a><span class="lineno">  860</span> </div>
<div class="line"><a id="l00879" name="l00879"></a><span class="lineno">  879</span><span class="keywordtype">int</span> pio_sm_init(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint initial_pc, <span class="keyword">const</span> <a class="code hl_struct" href="structpio__sm__config.html">pio_sm_config</a> *config);</div>
<div class="line"><a id="l00880" name="l00880"></a><span class="lineno">  880</span> </div>
<div class="line"><a id="l00888" name="l00888"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaa47ec4090dcdc251e44bf4e4cb89a7bc">  888</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gaa47ec4090dcdc251e44bf4e4cb89a7bc">pio_sm_set_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00889" name="l00889"></a><span class="lineno">  889</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00890" name="l00890"></a><span class="lineno">  890</span>    check_sm_param(sm);</div>
<div class="line"><a id="l00891" name="l00891"></a><span class="lineno">  891</span>    pio-&gt;ctrl = (pio-&gt;ctrl &amp; ~(1u &lt;&lt; sm)) | (bool_to_bit(enabled) &lt;&lt; sm);</div>
<div class="line"><a id="l00892" name="l00892"></a><span class="lineno">  892</span>}</div>
<div class="line"><a id="l00893" name="l00893"></a><span class="lineno">  893</span> </div>
<div class="line"><a id="l00907" name="l00907"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaf726f77ee21f5373cadf064a4e0b4935">  907</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gaf726f77ee21f5373cadf064a4e0b4935">pio_set_sm_mask_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00908" name="l00908"></a><span class="lineno">  908</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00909" name="l00909"></a><span class="lineno">  909</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l00910" name="l00910"></a><span class="lineno">  910</span>    pio-&gt;ctrl = (pio-&gt;ctrl &amp; ~mask) | (enabled ? mask : 0u);</div>
<div class="line"><a id="l00911" name="l00911"></a><span class="lineno">  911</span>}</div>
<div class="line"><a id="l00912" name="l00912"></a><span class="lineno">  912</span> </div>
<div class="line"><a id="l00913" name="l00913"></a><span class="lineno">  913</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l00929" name="l00929"></a><span class="lineno">  929</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> pio_set_sm_multi_mask_enabled(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t mask_prev, uint32_t mask, uint32_t mask_next, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l00930" name="l00930"></a><span class="lineno">  930</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00931" name="l00931"></a><span class="lineno">  931</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l00932" name="l00932"></a><span class="lineno">  932</span>    pio-&gt;ctrl = (pio-&gt;ctrl &amp; ~(mask &lt;&lt; PIO_CTRL_SM_ENABLE_LSB)) |</div>
<div class="line"><a id="l00933" name="l00933"></a><span class="lineno">  933</span>                (enabled ? ((mask &lt;&lt; PIO_CTRL_SM_ENABLE_LSB) &amp; PIO_CTRL_SM_ENABLE_BITS) : 0) |</div>
<div class="line"><a id="l00934" name="l00934"></a><span class="lineno">  934</span>                (enabled ? PIO_CTRL_NEXTPREV_SM_ENABLE_BITS : PIO_CTRL_NEXTPREV_SM_DISABLE_BITS) |</div>
<div class="line"><a id="l00935" name="l00935"></a><span class="lineno">  935</span>                ((mask_prev &lt;&lt; PIO_CTRL_PREV_PIO_MASK_LSB) &amp; PIO_CTRL_PREV_PIO_MASK_BITS) |</div>
<div class="line"><a id="l00936" name="l00936"></a><span class="lineno">  936</span>                ((mask_next &lt;&lt; PIO_CTRL_NEXT_PIO_MASK_LSB) &amp; PIO_CTRL_NEXT_PIO_MASK_BITS);</div>
<div class="line"><a id="l00937" name="l00937"></a><span class="lineno">  937</span> </div>
<div class="line"><a id="l00938" name="l00938"></a><span class="lineno">  938</span>}</div>
<div class="line"><a id="l00939" name="l00939"></a><span class="lineno">  939</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00940" name="l00940"></a><span class="lineno">  940</span> </div>
<div class="line"><a id="l00950" name="l00950"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga7b89b93dd0553c77538c70baf6a7e4f0">  950</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga7b89b93dd0553c77538c70baf6a7e4f0">pio_sm_restart</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l00951" name="l00951"></a><span class="lineno">  951</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00952" name="l00952"></a><span class="lineno">  952</span>    check_sm_param(sm);</div>
<div class="line"><a id="l00953" name="l00953"></a><span class="lineno">  953</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;ctrl, 1u &lt;&lt; (PIO_CTRL_SM_RESTART_LSB + sm));</div>
<div class="line"><a id="l00954" name="l00954"></a><span class="lineno">  954</span>}</div>
<div class="line"><a id="l00955" name="l00955"></a><span class="lineno">  955</span> </div>
<div class="line"><a id="l00965" name="l00965"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gae3e115fd41d9ac29c7a13b0c213bc2cd">  965</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gae3e115fd41d9ac29c7a13b0c213bc2cd">pio_restart_sm_mask</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t mask) {</div>
<div class="line"><a id="l00966" name="l00966"></a><span class="lineno">  966</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00967" name="l00967"></a><span class="lineno">  967</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l00968" name="l00968"></a><span class="lineno">  968</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;ctrl, (mask &lt;&lt; PIO_CTRL_SM_RESTART_LSB) &amp; PIO_CTRL_SM_RESTART_BITS);</div>
<div class="line"><a id="l00969" name="l00969"></a><span class="lineno">  969</span>}</div>
<div class="line"><a id="l00970" name="l00970"></a><span class="lineno">  970</span> </div>
<div class="line"><a id="l00992" name="l00992"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gacd981b2206b02eb1c4573a0f328d7819">  992</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gacd981b2206b02eb1c4573a0f328d7819">pio_sm_clkdiv_restart</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l00993" name="l00993"></a><span class="lineno">  993</span>    check_pio_param(pio);</div>
<div class="line"><a id="l00994" name="l00994"></a><span class="lineno">  994</span>    check_sm_param(sm);</div>
<div class="line"><a id="l00995" name="l00995"></a><span class="lineno">  995</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;ctrl, 1u &lt;&lt; (PIO_CTRL_CLKDIV_RESTART_LSB + sm));</div>
<div class="line"><a id="l00996" name="l00996"></a><span class="lineno">  996</span>}</div>
<div class="line"><a id="l00997" name="l00997"></a><span class="lineno">  997</span> </div>
<div class="line"><a id="l01027" name="l01027"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga63e13f639ae50ee9cb8afeceba6bb118"> 1027</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga63e13f639ae50ee9cb8afeceba6bb118">pio_clkdiv_restart_sm_mask</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t mask) {</div>
<div class="line"><a id="l01028" name="l01028"></a><span class="lineno"> 1028</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01029" name="l01029"></a><span class="lineno"> 1029</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l01030" name="l01030"></a><span class="lineno"> 1030</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;ctrl, (mask &lt;&lt; PIO_CTRL_CLKDIV_RESTART_LSB) &amp; PIO_CTRL_CLKDIV_RESTART_BITS);</div>
<div class="line"><a id="l01031" name="l01031"></a><span class="lineno"> 1031</span>}</div>
<div class="line"><a id="l01032" name="l01032"></a><span class="lineno"> 1032</span> </div>
<div class="line"><a id="l01033" name="l01033"></a><span class="lineno"> 1033</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l01065" name="l01065"></a><span class="lineno"> 1065</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> pio_clkdiv_restart_sm_multi_mask(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t mask_prev, uint32_t mask, uint32_t mask_next) {</div>
<div class="line"><a id="l01066" name="l01066"></a><span class="lineno"> 1066</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01067" name="l01067"></a><span class="lineno"> 1067</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l01068" name="l01068"></a><span class="lineno"> 1068</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;ctrl, ((mask &lt;&lt; PIO_CTRL_CLKDIV_RESTART_LSB) &amp; PIO_CTRL_CLKDIV_RESTART_BITS) |</div>
<div class="line"><a id="l01069" name="l01069"></a><span class="lineno"> 1069</span>                            PIO_CTRL_NEXTPREV_CLKDIV_RESTART_BITS |</div>
<div class="line"><a id="l01070" name="l01070"></a><span class="lineno"> 1070</span>                            ((mask_prev &lt;&lt; PIO_CTRL_PREV_PIO_MASK_LSB) &amp; PIO_CTRL_PREV_PIO_MASK_BITS) |</div>
<div class="line"><a id="l01071" name="l01071"></a><span class="lineno"> 1071</span>                            ((mask_next &lt;&lt; PIO_CTRL_NEXT_PIO_MASK_LSB) &amp; PIO_CTRL_NEXT_PIO_MASK_BITS));</div>
<div class="line"><a id="l01072" name="l01072"></a><span class="lineno"> 1072</span>}</div>
<div class="line"><a id="l01073" name="l01073"></a><span class="lineno"> 1073</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01074" name="l01074"></a><span class="lineno"> 1074</span> </div>
<div class="line"><a id="l01086" name="l01086"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gac3797a9f7e80606152eb44af9ca96398"> 1086</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gac3797a9f7e80606152eb44af9ca96398">pio_enable_sm_mask_in_sync</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t mask) {</div>
<div class="line"><a id="l01087" name="l01087"></a><span class="lineno"> 1087</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01088" name="l01088"></a><span class="lineno"> 1088</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l01089" name="l01089"></a><span class="lineno"> 1089</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;ctrl,</div>
<div class="line"><a id="l01090" name="l01090"></a><span class="lineno"> 1090</span>        ((mask &lt;&lt; PIO_CTRL_CLKDIV_RESTART_LSB) &amp; PIO_CTRL_CLKDIV_RESTART_BITS) |</div>
<div class="line"><a id="l01091" name="l01091"></a><span class="lineno"> 1091</span>        ((mask &lt;&lt; PIO_CTRL_SM_ENABLE_LSB) &amp; PIO_CTRL_SM_ENABLE_BITS));</div>
<div class="line"><a id="l01092" name="l01092"></a><span class="lineno"> 1092</span>}</div>
<div class="line"><a id="l01093" name="l01093"></a><span class="lineno"> 1093</span> </div>
<div class="line"><a id="l01094" name="l01094"></a><span class="lineno"> 1094</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l01108" name="l01108"></a><span class="lineno"> 1108</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> pio_enable_sm_multi_mask_in_sync(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t mask_prev, uint32_t mask, uint32_t mask_next) {</div>
<div class="line"><a id="l01109" name="l01109"></a><span class="lineno"> 1109</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01110" name="l01110"></a><span class="lineno"> 1110</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l01111" name="l01111"></a><span class="lineno"> 1111</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01112" name="l01112"></a><span class="lineno"> 1112</span>    check_sm_mask(mask);</div>
<div class="line"><a id="l01113" name="l01113"></a><span class="lineno"> 1113</span>    <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;ctrl, ((mask &lt;&lt; PIO_CTRL_CLKDIV_RESTART_LSB) &amp; PIO_CTRL_CLKDIV_RESTART_BITS) |</div>
<div class="line"><a id="l01114" name="l01114"></a><span class="lineno"> 1114</span>                            ((mask &lt;&lt; PIO_CTRL_SM_ENABLE_LSB) &amp; PIO_CTRL_SM_ENABLE_BITS) |</div>
<div class="line"><a id="l01115" name="l01115"></a><span class="lineno"> 1115</span>                            PIO_CTRL_NEXTPREV_CLKDIV_RESTART_BITS | PIO_CTRL_NEXTPREV_SM_ENABLE_BITS |</div>
<div class="line"><a id="l01116" name="l01116"></a><span class="lineno"> 1116</span>                            ((mask_prev &lt;&lt; PIO_CTRL_PREV_PIO_MASK_LSB) &amp; PIO_CTRL_PREV_PIO_MASK_BITS) |</div>
<div class="line"><a id="l01117" name="l01117"></a><span class="lineno"> 1117</span>                            ((mask_next &lt;&lt; PIO_CTRL_NEXT_PIO_MASK_LSB) &amp; PIO_CTRL_NEXT_PIO_MASK_BITS));</div>
<div class="line"><a id="l01118" name="l01118"></a><span class="lineno"> 1118</span>}</div>
<div class="line"><a id="l01119" name="l01119"></a><span class="lineno"> 1119</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01120" name="l01120"></a><span class="lineno"> 1120</span> </div>
<div class="line"><a id="l01124" name="l01124"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga0e60c768ea29f296b5ef40c02211bbcc"> 1124</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code hl_enumeration" href="group__hardware__pio.html#ga0e60c768ea29f296b5ef40c02211bbcc">pio_interrupt_source</a> {</div>
<div class="line"><a id="l01125" name="l01125"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca23610bee821f3f8fecbfad0e48c6d742"> 1125</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca23610bee821f3f8fecbfad0e48c6d742">pis_interrupt0</a> = PIO_INTR_SM0_LSB,                        </div>
<div class="line"><a id="l01126" name="l01126"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca6cd394d2b05ae5eec188d5283d16dc49"> 1126</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca6cd394d2b05ae5eec188d5283d16dc49">pis_interrupt1</a> = PIO_INTR_SM1_LSB,                        </div>
<div class="line"><a id="l01127" name="l01127"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca066e1cafa42ed6638c93cc09c9b1a0d4"> 1127</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca066e1cafa42ed6638c93cc09c9b1a0d4">pis_interrupt2</a> = PIO_INTR_SM2_LSB,                        </div>
<div class="line"><a id="l01128" name="l01128"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca94cf23106019a84873d6db52d1e8470f"> 1128</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca94cf23106019a84873d6db52d1e8470f">pis_interrupt3</a> = PIO_INTR_SM3_LSB,                        </div>
<div class="line"><a id="l01129" name="l01129"></a><span class="lineno"> 1129</span><span class="preprocessor">#if PICO_PIO_VERSION &gt; 0</span></div>
<div class="line"><a id="l01130" name="l01130"></a><span class="lineno"> 1130</span>    pis_interrupt4 = PIO_INTR_SM4_LSB,                        </div>
<div class="line"><a id="l01131" name="l01131"></a><span class="lineno"> 1131</span>    pis_interrupt5 = PIO_INTR_SM5_LSB,                        </div>
<div class="line"><a id="l01132" name="l01132"></a><span class="lineno"> 1132</span>    pis_interrupt6 = PIO_INTR_SM6_LSB,                        </div>
<div class="line"><a id="l01133" name="l01133"></a><span class="lineno"> 1133</span>    pis_interrupt7 = PIO_INTR_SM7_LSB,                        </div>
<div class="line"><a id="l01134" name="l01134"></a><span class="lineno"> 1134</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01135" name="l01135"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca924b2a1d4b6d257ac13608729dcf9ee1"> 1135</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca924b2a1d4b6d257ac13608729dcf9ee1">pis_sm0_tx_fifo_not_full</a> = PIO_INTR_SM0_TXNFULL_LSB,      </div>
<div class="line"><a id="l01136" name="l01136"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca27452b43a8d5d40ab0ba25a195681d48"> 1136</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca27452b43a8d5d40ab0ba25a195681d48">pis_sm1_tx_fifo_not_full</a> = PIO_INTR_SM1_TXNFULL_LSB,      </div>
<div class="line"><a id="l01137" name="l01137"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca214d3bdb6ebc516c4094c4eb476d514d"> 1137</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca214d3bdb6ebc516c4094c4eb476d514d">pis_sm2_tx_fifo_not_full</a> = PIO_INTR_SM2_TXNFULL_LSB,      </div>
<div class="line"><a id="l01138" name="l01138"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca463c09bec3151921a18be2c548e97297"> 1138</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca463c09bec3151921a18be2c548e97297">pis_sm3_tx_fifo_not_full</a> = PIO_INTR_SM3_TXNFULL_LSB,      </div>
<div class="line"><a id="l01139" name="l01139"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca959e0b9e484719a0af543fb87a365d52"> 1139</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca959e0b9e484719a0af543fb87a365d52">pis_sm0_rx_fifo_not_empty</a> = PIO_INTR_SM0_RXNEMPTY_LSB,    </div>
<div class="line"><a id="l01140" name="l01140"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca85ee2774a8e5dfaf61d3866a81cb381c"> 1140</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca85ee2774a8e5dfaf61d3866a81cb381c">pis_sm1_rx_fifo_not_empty</a> = PIO_INTR_SM1_RXNEMPTY_LSB,    </div>
<div class="line"><a id="l01141" name="l01141"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca6d7f4a904cb634fd3f30f033874393ac"> 1141</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca6d7f4a904cb634fd3f30f033874393ac">pis_sm2_rx_fifo_not_empty</a> = PIO_INTR_SM2_RXNEMPTY_LSB,    </div>
<div class="line"><a id="l01142" name="l01142"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbccaacce0dbc391b9bb05965b7bc1b6f7698"> 1142</a></span>    <a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbccaacce0dbc391b9bb05965b7bc1b6f7698">pis_sm3_rx_fifo_not_empty</a> = PIO_INTR_SM3_RXNEMPTY_LSB,    </div>
<div class="line"><a id="l01143" name="l01143"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe"> 1143</a></span>} <a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a>;</div>
<div class="line"><a id="l01144" name="l01144"></a><span class="lineno"> 1144</span> </div>
<div class="line"><a id="l01152" name="l01152"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gafe39a664c508e08ef4c74b7c3c38bc07"> 1152</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gafe39a664c508e08ef4c74b7c3c38bc07">pio_set_irq0_source_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a> source, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l01153" name="l01153"></a><span class="lineno"> 1153</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01154" name="l01154"></a><span class="lineno"> 1154</span>    invalid_params_if(HARDWARE_PIO, source &gt;= 32u || (1u &lt;&lt; source) &gt; PIO_INTR_BITS);</div>
<div class="line"><a id="l01155" name="l01155"></a><span class="lineno"> 1155</span>    <span class="keywordflow">if</span> (enabled)</div>
<div class="line"><a id="l01156" name="l01156"></a><span class="lineno"> 1156</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;inte0, 1u &lt;&lt; source);</div>
<div class="line"><a id="l01157" name="l01157"></a><span class="lineno"> 1157</span>    <span class="keywordflow">else</span></div>
<div class="line"><a id="l01158" name="l01158"></a><span class="lineno"> 1158</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pio-&gt;inte0, 1u &lt;&lt; source);</div>
<div class="line"><a id="l01159" name="l01159"></a><span class="lineno"> 1159</span>}</div>
<div class="line"><a id="l01160" name="l01160"></a><span class="lineno"> 1160</span> </div>
<div class="line"><a id="l01168" name="l01168"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga4369e665ee8d2db58a83eccad65c917c"> 1168</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga4369e665ee8d2db58a83eccad65c917c">pio_set_irq1_source_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a> source, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l01169" name="l01169"></a><span class="lineno"> 1169</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01170" name="l01170"></a><span class="lineno"> 1170</span>    invalid_params_if(HARDWARE_PIO, source &gt;= 32 || (1u &lt;&lt; source) &gt; PIO_INTR_BITS);</div>
<div class="line"><a id="l01171" name="l01171"></a><span class="lineno"> 1171</span>    <span class="keywordflow">if</span> (enabled)</div>
<div class="line"><a id="l01172" name="l01172"></a><span class="lineno"> 1172</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;inte1, 1u &lt;&lt; source);</div>
<div class="line"><a id="l01173" name="l01173"></a><span class="lineno"> 1173</span>    <span class="keywordflow">else</span></div>
<div class="line"><a id="l01174" name="l01174"></a><span class="lineno"> 1174</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pio-&gt;inte1, 1u &lt;&lt; source);</div>
<div class="line"><a id="l01175" name="l01175"></a><span class="lineno"> 1175</span>}</div>
<div class="line"><a id="l01176" name="l01176"></a><span class="lineno"> 1176</span> </div>
<div class="line"><a id="l01184" name="l01184"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga81259bc71fd3bd81b96e47f9f4ea7b67"> 1184</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga81259bc71fd3bd81b96e47f9f4ea7b67">pio_set_irq0_source_mask_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t source_mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l01185" name="l01185"></a><span class="lineno"> 1185</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01186" name="l01186"></a><span class="lineno"> 1186</span>    invalid_params_if(HARDWARE_PIO, source_mask &gt; PIO_INTR_BITS);</div>
<div class="line"><a id="l01187" name="l01187"></a><span class="lineno"> 1187</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l01188" name="l01188"></a><span class="lineno"> 1188</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;inte0, source_mask);</div>
<div class="line"><a id="l01189" name="l01189"></a><span class="lineno"> 1189</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l01190" name="l01190"></a><span class="lineno"> 1190</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pio-&gt;inte0, source_mask);</div>
<div class="line"><a id="l01191" name="l01191"></a><span class="lineno"> 1191</span>    }</div>
<div class="line"><a id="l01192" name="l01192"></a><span class="lineno"> 1192</span>}</div>
<div class="line"><a id="l01193" name="l01193"></a><span class="lineno"> 1193</span> </div>
<div class="line"><a id="l01201" name="l01201"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gae39150dd6910d2776484526059911b79"> 1201</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gae39150dd6910d2776484526059911b79">pio_set_irq1_source_mask_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint32_t source_mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l01202" name="l01202"></a><span class="lineno"> 1202</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01203" name="l01203"></a><span class="lineno"> 1203</span>    invalid_params_if(HARDWARE_PIO, source_mask &gt; PIO_INTR_BITS);</div>
<div class="line"><a id="l01204" name="l01204"></a><span class="lineno"> 1204</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l01205" name="l01205"></a><span class="lineno"> 1205</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;inte1, source_mask);</div>
<div class="line"><a id="l01206" name="l01206"></a><span class="lineno"> 1206</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l01207" name="l01207"></a><span class="lineno"> 1207</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pio-&gt;inte1, source_mask);</div>
<div class="line"><a id="l01208" name="l01208"></a><span class="lineno"> 1208</span>    }</div>
<div class="line"><a id="l01209" name="l01209"></a><span class="lineno"> 1209</span>}</div>
<div class="line"><a id="l01210" name="l01210"></a><span class="lineno"> 1210</span> </div>
<div class="line"><a id="l01219" name="l01219"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga06d0fd918247a86e8394afac67cf6992"> 1219</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga06d0fd918247a86e8394afac67cf6992">pio_set_irqn_source_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint irq_index, <a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a> source, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l01220" name="l01220"></a><span class="lineno"> 1220</span>    invalid_params_if(HARDWARE_PIO, irq_index &gt; NUM_PIO_IRQS);</div>
<div class="line"><a id="l01221" name="l01221"></a><span class="lineno"> 1221</span>    invalid_params_if(HARDWARE_PIO, source &gt;= 32 || (1u &lt;&lt; source) &gt; PIO_INTR_BITS);</div>
<div class="line"><a id="l01222" name="l01222"></a><span class="lineno"> 1222</span>    <span class="keywordflow">if</span> (enabled)</div>
<div class="line"><a id="l01223" name="l01223"></a><span class="lineno"> 1223</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;irq_ctrl[irq_index].inte, 1u &lt;&lt; source);</div>
<div class="line"><a id="l01224" name="l01224"></a><span class="lineno"> 1224</span>    <span class="keywordflow">else</span></div>
<div class="line"><a id="l01225" name="l01225"></a><span class="lineno"> 1225</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pio-&gt;irq_ctrl[irq_index].inte, 1u &lt;&lt; source);</div>
<div class="line"><a id="l01226" name="l01226"></a><span class="lineno"> 1226</span>}</div>
<div class="line"><a id="l01227" name="l01227"></a><span class="lineno"> 1227</span> </div>
<div class="line"><a id="l01236" name="l01236"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gafc173eb3cb980ed3c823384e42e265bb"> 1236</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gafc173eb3cb980ed3c823384e42e265bb">pio_set_irqn_source_mask_enabled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint irq_index, uint32_t source_mask, <span class="keywordtype">bool</span> enabled) {</div>
<div class="line"><a id="l01237" name="l01237"></a><span class="lineno"> 1237</span>    invalid_params_if(HARDWARE_PIO, irq_index &gt; NUM_PIO_IRQS);</div>
<div class="line"><a id="l01238" name="l01238"></a><span class="lineno"> 1238</span>    <span class="keyword">static_assert</span>(NUM_PIO_IRQS == 2, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l01239" name="l01239"></a><span class="lineno"> 1239</span>    invalid_params_if(HARDWARE_PIO, source_mask &gt; PIO_INTR_BITS);</div>
<div class="line"><a id="l01240" name="l01240"></a><span class="lineno"> 1240</span>    <span class="keywordflow">if</span> (enabled) {</div>
<div class="line"><a id="l01241" name="l01241"></a><span class="lineno"> 1241</span>        <a class="code hl_function" href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a>(&amp;pio-&gt;irq_ctrl[irq_index].inte, source_mask);</div>
<div class="line"><a id="l01242" name="l01242"></a><span class="lineno"> 1242</span>    } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l01243" name="l01243"></a><span class="lineno"> 1243</span>        <a class="code hl_function" href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a>(&amp;pio-&gt;irq_ctrl[irq_index].inte, source_mask);</div>
<div class="line"><a id="l01244" name="l01244"></a><span class="lineno"> 1244</span>    }</div>
<div class="line"><a id="l01245" name="l01245"></a><span class="lineno"> 1245</span>}</div>
<div class="line"><a id="l01246" name="l01246"></a><span class="lineno"> 1246</span> </div>
<div class="line"><a id="l01254" name="l01254"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaa92c20b2d08f3b8a6bc35cd602a092e4"> 1254</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#gaa92c20b2d08f3b8a6bc35cd602a092e4">pio_interrupt_get</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint pio_interrupt_num) {</div>
<div class="line"><a id="l01255" name="l01255"></a><span class="lineno"> 1255</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01256" name="l01256"></a><span class="lineno"> 1256</span>    invalid_params_if(HARDWARE_PIO, pio_interrupt_num &gt;= 8);</div>
<div class="line"><a id="l01257" name="l01257"></a><span class="lineno"> 1257</span>    <span class="keywordflow">return</span> pio-&gt;irq &amp; (1u &lt;&lt; pio_interrupt_num);</div>
<div class="line"><a id="l01258" name="l01258"></a><span class="lineno"> 1258</span>}</div>
<div class="line"><a id="l01259" name="l01259"></a><span class="lineno"> 1259</span> </div>
<div class="line"><a id="l01266" name="l01266"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga6f650eb98640eac2346ff26b46dc378b"> 1266</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga6f650eb98640eac2346ff26b46dc378b">pio_interrupt_clear</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint pio_interrupt_num) {</div>
<div class="line"><a id="l01267" name="l01267"></a><span class="lineno"> 1267</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01268" name="l01268"></a><span class="lineno"> 1268</span>    invalid_params_if(HARDWARE_PIO, pio_interrupt_num &gt;= 8);</div>
<div class="line"><a id="l01269" name="l01269"></a><span class="lineno"> 1269</span>    pio-&gt;irq = (1u &lt;&lt; pio_interrupt_num);</div>
<div class="line"><a id="l01270" name="l01270"></a><span class="lineno"> 1270</span>}</div>
<div class="line"><a id="l01271" name="l01271"></a><span class="lineno"> 1271</span> </div>
<div class="line"><a id="l01279" name="l01279"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga9c0ea409da4fcb98586120b575921c31"> 1279</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint8_t <a class="code hl_function" href="group__hardware__pio.html#ga9c0ea409da4fcb98586120b575921c31">pio_sm_get_pc</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01280" name="l01280"></a><span class="lineno"> 1280</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01281" name="l01281"></a><span class="lineno"> 1281</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01282" name="l01282"></a><span class="lineno"> 1282</span>    <span class="keywordflow">return</span> (uint8_t) pio-&gt;sm[sm].addr;</div>
<div class="line"><a id="l01283" name="l01283"></a><span class="lineno"> 1283</span>}</div>
<div class="line"><a id="l01284" name="l01284"></a><span class="lineno"> 1284</span> </div>
<div class="line"><a id="l01297" name="l01297"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga800d8949b5d04dfe635d4c12241f0cd2"> 1297</a></span><span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga800d8949b5d04dfe635d4c12241f0cd2">pio_sm_exec</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint instr) {</div>
<div class="line"><a id="l01298" name="l01298"></a><span class="lineno"> 1298</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01299" name="l01299"></a><span class="lineno"> 1299</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01300" name="l01300"></a><span class="lineno"> 1300</span>    pio-&gt;sm[sm].instr = instr;</div>
<div class="line"><a id="l01301" name="l01301"></a><span class="lineno"> 1301</span>}</div>
<div class="line"><a id="l01302" name="l01302"></a><span class="lineno"> 1302</span> </div>
<div class="line"><a id="l01310" name="l01310"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaaa44e504a2abd8ca2c1ee2db91d0652b"> 1310</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#gaaa44e504a2abd8ca2c1ee2db91d0652b">pio_sm_is_exec_stalled</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01311" name="l01311"></a><span class="lineno"> 1311</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01312" name="l01312"></a><span class="lineno"> 1312</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01313" name="l01313"></a><span class="lineno"> 1313</span>    <span class="keywordflow">return</span> pio-&gt;sm[sm].execctrl &amp; PIO_SM0_EXECCTRL_EXEC_STALLED_BITS;</div>
<div class="line"><a id="l01314" name="l01314"></a><span class="lineno"> 1314</span>}</div>
<div class="line"><a id="l01315" name="l01315"></a><span class="lineno"> 1315</span> </div>
<div class="line"><a id="l01328" name="l01328"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga1bf1b296713b76e19b87b59b84136b2c"> 1328</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga1bf1b296713b76e19b87b59b84136b2c">pio_sm_exec_wait_blocking</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint instr) {</div>
<div class="line"><a id="l01329" name="l01329"></a><span class="lineno"> 1329</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01330" name="l01330"></a><span class="lineno"> 1330</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01331" name="l01331"></a><span class="lineno"> 1331</span>    <a class="code hl_function" href="group__hardware__pio.html#ga800d8949b5d04dfe635d4c12241f0cd2">pio_sm_exec</a>(pio, sm, instr);</div>
<div class="line"><a id="l01332" name="l01332"></a><span class="lineno"> 1332</span>    <span class="keywordflow">while</span> (<a class="code hl_function" href="group__hardware__pio.html#gaaa44e504a2abd8ca2c1ee2db91d0652b">pio_sm_is_exec_stalled</a>(pio, sm)) <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l01333" name="l01333"></a><span class="lineno"> 1333</span>}</div>
<div class="line"><a id="l01334" name="l01334"></a><span class="lineno"> 1334</span> </div>
<div class="line"><a id="l01344" name="l01344"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga74a681208957ab2bc8c8aafff9bb9f7c"> 1344</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga74a681208957ab2bc8c8aafff9bb9f7c">pio_sm_set_wrap</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint wrap_target, uint wrap) {</div>
<div class="line"><a id="l01345" name="l01345"></a><span class="lineno"> 1345</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01346" name="l01346"></a><span class="lineno"> 1346</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01347" name="l01347"></a><span class="lineno"> 1347</span>    valid_params_if(HARDWARE_PIO, wrap &lt; PIO_INSTRUCTION_COUNT);</div>
<div class="line"><a id="l01348" name="l01348"></a><span class="lineno"> 1348</span>    valid_params_if(HARDWARE_PIO, wrap_target &lt; PIO_INSTRUCTION_COUNT);</div>
<div class="line"><a id="l01349" name="l01349"></a><span class="lineno"> 1349</span>    pio-&gt;sm[sm].execctrl =</div>
<div class="line"><a id="l01350" name="l01350"></a><span class="lineno"> 1350</span>            (pio-&gt;sm[sm].execctrl &amp; ~(PIO_SM0_EXECCTRL_WRAP_TOP_BITS | PIO_SM0_EXECCTRL_WRAP_BOTTOM_BITS)) |</div>
<div class="line"><a id="l01351" name="l01351"></a><span class="lineno"> 1351</span>            (wrap_target &lt;&lt; PIO_SM0_EXECCTRL_WRAP_BOTTOM_LSB) |</div>
<div class="line"><a id="l01352" name="l01352"></a><span class="lineno"> 1352</span>            (wrap &lt;&lt; PIO_SM0_EXECCTRL_WRAP_TOP_LSB);</div>
<div class="line"><a id="l01353" name="l01353"></a><span class="lineno"> 1353</span>}</div>
<div class="line"><a id="l01354" name="l01354"></a><span class="lineno"> 1354</span> </div>
<div class="line"><a id="l01365" name="l01365"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga7f0190e662c5b6e24d91044b42010ffc"> 1365</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga7f0190e662c5b6e24d91044b42010ffc">pio_sm_set_out_pins</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint out_base, uint out_count) {</div>
<div class="line"><a id="l01366" name="l01366"></a><span class="lineno"> 1366</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01367" name="l01367"></a><span class="lineno"> 1367</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01368" name="l01368"></a><span class="lineno"> 1368</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l01369" name="l01369"></a><span class="lineno"> 1369</span>    out_base -= <a class="code hl_function" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a>(pio);</div>
<div class="line"><a id="l01370" name="l01370"></a><span class="lineno"> 1370</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01371" name="l01371"></a><span class="lineno"> 1371</span>    valid_params_if(HARDWARE_PIO, out_base &lt; 32);</div>
<div class="line"><a id="l01372" name="l01372"></a><span class="lineno"> 1372</span>    valid_params_if(HARDWARE_PIO, out_count &lt;= 32);</div>
<div class="line"><a id="l01373" name="l01373"></a><span class="lineno"> 1373</span>    pio-&gt;sm[sm].pinctrl = (pio-&gt;sm[sm].pinctrl &amp; ~(PIO_SM0_PINCTRL_OUT_BASE_BITS | PIO_SM0_PINCTRL_OUT_COUNT_BITS)) |</div>
<div class="line"><a id="l01374" name="l01374"></a><span class="lineno"> 1374</span>                 (out_base &lt;&lt; PIO_SM0_PINCTRL_OUT_BASE_LSB) |</div>
<div class="line"><a id="l01375" name="l01375"></a><span class="lineno"> 1375</span>                 (out_count &lt;&lt; PIO_SM0_PINCTRL_OUT_COUNT_LSB);</div>
<div class="line"><a id="l01376" name="l01376"></a><span class="lineno"> 1376</span>}</div>
<div class="line"><a id="l01377" name="l01377"></a><span class="lineno"> 1377</span> </div>
<div class="line"><a id="l01378" name="l01378"></a><span class="lineno"> 1378</span> </div>
<div class="line"><a id="l01389" name="l01389"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gacaf6ee284dc834fbb742d1eef6180e6c"> 1389</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gacaf6ee284dc834fbb742d1eef6180e6c">pio_sm_set_set_pins</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint set_base, uint set_count) {</div>
<div class="line"><a id="l01390" name="l01390"></a><span class="lineno"> 1390</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01391" name="l01391"></a><span class="lineno"> 1391</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01392" name="l01392"></a><span class="lineno"> 1392</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l01393" name="l01393"></a><span class="lineno"> 1393</span>    set_base -= <a class="code hl_function" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a>(pio);</div>
<div class="line"><a id="l01394" name="l01394"></a><span class="lineno"> 1394</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01395" name="l01395"></a><span class="lineno"> 1395</span>    valid_params_if(HARDWARE_PIO, set_base &lt; 32);</div>
<div class="line"><a id="l01396" name="l01396"></a><span class="lineno"> 1396</span>    valid_params_if(HARDWARE_PIO, set_count &lt;= 5);</div>
<div class="line"><a id="l01397" name="l01397"></a><span class="lineno"> 1397</span>    pio-&gt;sm[sm].pinctrl = (pio-&gt;sm[sm].pinctrl &amp; ~(PIO_SM0_PINCTRL_SET_BASE_BITS | PIO_SM0_PINCTRL_SET_COUNT_BITS)) |</div>
<div class="line"><a id="l01398" name="l01398"></a><span class="lineno"> 1398</span>                 (set_base &lt;&lt; PIO_SM0_PINCTRL_SET_BASE_LSB) |</div>
<div class="line"><a id="l01399" name="l01399"></a><span class="lineno"> 1399</span>                 (set_count &lt;&lt; PIO_SM0_PINCTRL_SET_COUNT_LSB);</div>
<div class="line"><a id="l01400" name="l01400"></a><span class="lineno"> 1400</span>}</div>
<div class="line"><a id="l01401" name="l01401"></a><span class="lineno"> 1401</span> </div>
<div class="line"><a id="l01411" name="l01411"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaef50ef92f7ea0666dffe939c0b3fd24c"> 1411</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gaef50ef92f7ea0666dffe939c0b3fd24c">pio_sm_set_in_pins</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint in_base) {</div>
<div class="line"><a id="l01412" name="l01412"></a><span class="lineno"> 1412</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01413" name="l01413"></a><span class="lineno"> 1413</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01414" name="l01414"></a><span class="lineno"> 1414</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l01415" name="l01415"></a><span class="lineno"> 1415</span>    in_base -= <a class="code hl_function" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a>(pio);</div>
<div class="line"><a id="l01416" name="l01416"></a><span class="lineno"> 1416</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01417" name="l01417"></a><span class="lineno"> 1417</span>    valid_params_if(HARDWARE_PIO, in_base &lt; 32);</div>
<div class="line"><a id="l01418" name="l01418"></a><span class="lineno"> 1418</span>    pio-&gt;sm[sm].pinctrl = (pio-&gt;sm[sm].pinctrl &amp; ~PIO_SM0_PINCTRL_IN_BASE_BITS) |</div>
<div class="line"><a id="l01419" name="l01419"></a><span class="lineno"> 1419</span>                 (in_base &lt;&lt; PIO_SM0_PINCTRL_IN_BASE_LSB);</div>
<div class="line"><a id="l01420" name="l01420"></a><span class="lineno"> 1420</span>}</div>
<div class="line"><a id="l01421" name="l01421"></a><span class="lineno"> 1421</span> </div>
<div class="line"><a id="l01431" name="l01431"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga87cb36afe5783e2e92bf528b1d50ea07"> 1431</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga87cb36afe5783e2e92bf528b1d50ea07">pio_sm_set_sideset_pins</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint sideset_base) {</div>
<div class="line"><a id="l01432" name="l01432"></a><span class="lineno"> 1432</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01433" name="l01433"></a><span class="lineno"> 1433</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01434" name="l01434"></a><span class="lineno"> 1434</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l01435" name="l01435"></a><span class="lineno"> 1435</span>    sideset_base -= <a class="code hl_function" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a>(pio);</div>
<div class="line"><a id="l01436" name="l01436"></a><span class="lineno"> 1436</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01437" name="l01437"></a><span class="lineno"> 1437</span>    valid_params_if(HARDWARE_PIO, sideset_base &lt; 32);</div>
<div class="line"><a id="l01438" name="l01438"></a><span class="lineno"> 1438</span>    pio-&gt;sm[sm].pinctrl = (pio-&gt;sm[sm].pinctrl &amp; ~PIO_SM0_PINCTRL_SIDESET_BASE_BITS) |</div>
<div class="line"><a id="l01439" name="l01439"></a><span class="lineno"> 1439</span>                 (sideset_base &lt;&lt; PIO_SM0_PINCTRL_SIDESET_BASE_LSB);</div>
<div class="line"><a id="l01440" name="l01440"></a><span class="lineno"> 1440</span>}</div>
<div class="line"><a id="l01441" name="l01441"></a><span class="lineno"> 1441</span> </div>
<div class="line"><a id="l01450" name="l01450"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga97b135c9016b91fbf237c93313d25fd4"> 1450</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga97b135c9016b91fbf237c93313d25fd4">pio_sm_set_jmp_pin</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint pin) {</div>
<div class="line"><a id="l01451" name="l01451"></a><span class="lineno"> 1451</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01452" name="l01452"></a><span class="lineno"> 1452</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01453" name="l01453"></a><span class="lineno"> 1453</span><span class="preprocessor">#if PICO_PIO_USE_GPIO_BASE</span></div>
<div class="line"><a id="l01454" name="l01454"></a><span class="lineno"> 1454</span>    pin -= <a class="code hl_function" href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a>(pio);</div>
<div class="line"><a id="l01455" name="l01455"></a><span class="lineno"> 1455</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01456" name="l01456"></a><span class="lineno"> 1456</span>    valid_params_if(HARDWARE_PIO, pin &lt; 32);</div>
<div class="line"><a id="l01457" name="l01457"></a><span class="lineno"> 1457</span>    pio-&gt;sm[sm].execctrl =</div>
<div class="line"><a id="l01458" name="l01458"></a><span class="lineno"> 1458</span>        (pio-&gt;sm[sm].execctrl &amp; ~PIO_SM0_EXECCTRL_JMP_PIN_BITS)</div>
<div class="line"><a id="l01459" name="l01459"></a><span class="lineno"> 1459</span>        | (pin &lt;&lt; PIO_SM0_EXECCTRL_JMP_PIN_LSB);</div>
<div class="line"><a id="l01460" name="l01460"></a><span class="lineno"> 1460</span>}</div>
<div class="line"><a id="l01461" name="l01461"></a><span class="lineno"> 1461</span> </div>
<div class="line"><a id="l01476" name="l01476"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gab48b30da795dcd73b4a998d67a4af235"> 1476</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gab48b30da795dcd73b4a998d67a4af235">pio_sm_put</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint32_t data) {</div>
<div class="line"><a id="l01477" name="l01477"></a><span class="lineno"> 1477</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01478" name="l01478"></a><span class="lineno"> 1478</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01479" name="l01479"></a><span class="lineno"> 1479</span>    pio-&gt;txf[sm] = data;</div>
<div class="line"><a id="l01480" name="l01480"></a><span class="lineno"> 1480</span>}</div>
<div class="line"><a id="l01481" name="l01481"></a><span class="lineno"> 1481</span> </div>
<div class="line"><a id="l01497" name="l01497"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga6fe6273d63665fdb16964790d55709fa"> 1497</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code hl_function" href="group__hardware__pio.html#ga6fe6273d63665fdb16964790d55709fa">pio_sm_get</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01498" name="l01498"></a><span class="lineno"> 1498</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01499" name="l01499"></a><span class="lineno"> 1499</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01500" name="l01500"></a><span class="lineno"> 1500</span>    <span class="keywordflow">return</span> pio-&gt;rxf[sm];</div>
<div class="line"><a id="l01501" name="l01501"></a><span class="lineno"> 1501</span>}</div>
<div class="line"><a id="l01502" name="l01502"></a><span class="lineno"> 1502</span> </div>
<div class="line"><a id="l01510" name="l01510"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga71e388315eb6a77a6560b77ec13145a4"> 1510</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#ga71e388315eb6a77a6560b77ec13145a4">pio_sm_is_rx_fifo_full</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01511" name="l01511"></a><span class="lineno"> 1511</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01512" name="l01512"></a><span class="lineno"> 1512</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01513" name="l01513"></a><span class="lineno"> 1513</span>    <span class="keywordflow">return</span> (pio-&gt;fstat &amp; (1u &lt;&lt; (PIO_FSTAT_RXFULL_LSB + sm))) != 0;</div>
<div class="line"><a id="l01514" name="l01514"></a><span class="lineno"> 1514</span>}</div>
<div class="line"><a id="l01515" name="l01515"></a><span class="lineno"> 1515</span> </div>
<div class="line"><a id="l01523" name="l01523"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gadf404ba44b7f83e79fd6b57b3e2c89df"> 1523</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#gadf404ba44b7f83e79fd6b57b3e2c89df">pio_sm_is_rx_fifo_empty</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01524" name="l01524"></a><span class="lineno"> 1524</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01525" name="l01525"></a><span class="lineno"> 1525</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01526" name="l01526"></a><span class="lineno"> 1526</span>    <span class="keywordflow">return</span> (pio-&gt;fstat &amp; (1u &lt;&lt; (PIO_FSTAT_RXEMPTY_LSB + sm))) != 0;</div>
<div class="line"><a id="l01527" name="l01527"></a><span class="lineno"> 1527</span>}</div>
<div class="line"><a id="l01528" name="l01528"></a><span class="lineno"> 1528</span> </div>
<div class="line"><a id="l01536" name="l01536"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga8fa0b87fde0db10be2934de542f9d6c2"> 1536</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pio.html#ga8fa0b87fde0db10be2934de542f9d6c2">pio_sm_get_rx_fifo_level</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01537" name="l01537"></a><span class="lineno"> 1537</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01538" name="l01538"></a><span class="lineno"> 1538</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01539" name="l01539"></a><span class="lineno"> 1539</span>    uint bitoffs = PIO_FLEVEL_RX0_LSB + sm * (PIO_FLEVEL_RX1_LSB - PIO_FLEVEL_RX0_LSB);</div>
<div class="line"><a id="l01540" name="l01540"></a><span class="lineno"> 1540</span>    <span class="keyword">const</span> uint32_t mask = PIO_FLEVEL_RX0_BITS &gt;&gt; PIO_FLEVEL_RX0_LSB;</div>
<div class="line"><a id="l01541" name="l01541"></a><span class="lineno"> 1541</span>    <span class="keywordflow">return</span> (pio-&gt;flevel &gt;&gt; bitoffs) &amp; mask;</div>
<div class="line"><a id="l01542" name="l01542"></a><span class="lineno"> 1542</span>}</div>
<div class="line"><a id="l01543" name="l01543"></a><span class="lineno"> 1543</span> </div>
<div class="line"><a id="l01551" name="l01551"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga3dbf64343a2fba75549ee7b0351f7e52"> 1551</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#ga3dbf64343a2fba75549ee7b0351f7e52">pio_sm_is_tx_fifo_full</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01552" name="l01552"></a><span class="lineno"> 1552</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01553" name="l01553"></a><span class="lineno"> 1553</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01554" name="l01554"></a><span class="lineno"> 1554</span>    <span class="keywordflow">return</span> (pio-&gt;fstat &amp; (1u &lt;&lt; (PIO_FSTAT_TXFULL_LSB + sm))) != 0;</div>
<div class="line"><a id="l01555" name="l01555"></a><span class="lineno"> 1555</span>}</div>
<div class="line"><a id="l01556" name="l01556"></a><span class="lineno"> 1556</span> </div>
<div class="line"><a id="l01564" name="l01564"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gadf4ae3f4a334c1dcac1b62b148508bf2"> 1564</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#gadf4ae3f4a334c1dcac1b62b148508bf2">pio_sm_is_tx_fifo_empty</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01565" name="l01565"></a><span class="lineno"> 1565</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01566" name="l01566"></a><span class="lineno"> 1566</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01567" name="l01567"></a><span class="lineno"> 1567</span>    <span class="keywordflow">return</span> (pio-&gt;fstat &amp; (1u &lt;&lt; (PIO_FSTAT_TXEMPTY_LSB + sm))) != 0;</div>
<div class="line"><a id="l01568" name="l01568"></a><span class="lineno"> 1568</span>}</div>
<div class="line"><a id="l01569" name="l01569"></a><span class="lineno"> 1569</span> </div>
<div class="line"><a id="l01577" name="l01577"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga009b3f44f112208114972c32546dfddb"> 1577</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__pio.html#ga009b3f44f112208114972c32546dfddb">pio_sm_get_tx_fifo_level</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01578" name="l01578"></a><span class="lineno"> 1578</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01579" name="l01579"></a><span class="lineno"> 1579</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01580" name="l01580"></a><span class="lineno"> 1580</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bitoffs = PIO_FLEVEL_TX0_LSB + sm * (PIO_FLEVEL_TX1_LSB - PIO_FLEVEL_TX0_LSB);</div>
<div class="line"><a id="l01581" name="l01581"></a><span class="lineno"> 1581</span>    <span class="keyword">const</span> uint32_t mask = PIO_FLEVEL_TX0_BITS &gt;&gt; PIO_FLEVEL_TX0_LSB;</div>
<div class="line"><a id="l01582" name="l01582"></a><span class="lineno"> 1582</span>    <span class="keywordflow">return</span> (pio-&gt;flevel &gt;&gt; bitoffs) &amp; mask;</div>
<div class="line"><a id="l01583" name="l01583"></a><span class="lineno"> 1583</span>}</div>
<div class="line"><a id="l01584" name="l01584"></a><span class="lineno"> 1584</span> </div>
<div class="line"><a id="l01592" name="l01592"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaee8bfc3409cb8d93cccdeda3961bc377"> 1592</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gaee8bfc3409cb8d93cccdeda3961bc377">pio_sm_put_blocking</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint32_t data) {</div>
<div class="line"><a id="l01593" name="l01593"></a><span class="lineno"> 1593</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01594" name="l01594"></a><span class="lineno"> 1594</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01595" name="l01595"></a><span class="lineno"> 1595</span>    <span class="keywordflow">while</span> (<a class="code hl_function" href="group__hardware__pio.html#ga3dbf64343a2fba75549ee7b0351f7e52">pio_sm_is_tx_fifo_full</a>(pio, sm)) <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l01596" name="l01596"></a><span class="lineno"> 1596</span>    <a class="code hl_function" href="group__hardware__pio.html#gab48b30da795dcd73b4a998d67a4af235">pio_sm_put</a>(pio, sm, data);</div>
<div class="line"><a id="l01597" name="l01597"></a><span class="lineno"> 1597</span>}</div>
<div class="line"><a id="l01598" name="l01598"></a><span class="lineno"> 1598</span> </div>
<div class="line"><a id="l01605" name="l01605"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga12650f49c110cb1bfd8092ab67210885"> 1605</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code hl_function" href="group__hardware__pio.html#ga12650f49c110cb1bfd8092ab67210885">pio_sm_get_blocking</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01606" name="l01606"></a><span class="lineno"> 1606</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01607" name="l01607"></a><span class="lineno"> 1607</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01608" name="l01608"></a><span class="lineno"> 1608</span>    <span class="keywordflow">while</span> (<a class="code hl_function" href="group__hardware__pio.html#gadf404ba44b7f83e79fd6b57b3e2c89df">pio_sm_is_rx_fifo_empty</a>(pio, sm)) <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l01609" name="l01609"></a><span class="lineno"> 1609</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__hardware__pio.html#ga6fe6273d63665fdb16964790d55709fa">pio_sm_get</a>(pio, sm);</div>
<div class="line"><a id="l01610" name="l01610"></a><span class="lineno"> 1610</span>}</div>
<div class="line"><a id="l01611" name="l01611"></a><span class="lineno"> 1611</span> </div>
<div class="line"><a id="l01625" name="l01625"></a><span class="lineno"> 1625</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga46af88f03a0c5abe4d55d45c5b2ccfb7">pio_sm_drain_tx_fifo</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm);</div>
<div class="line"><a id="l01626" name="l01626"></a><span class="lineno"> 1626</span> </div>
<div class="line"><a id="l01635" name="l01635"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gaa9d1d18a7decd0068b8a2a9159c9fd34"> 1635</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gaa9d1d18a7decd0068b8a2a9159c9fd34">pio_sm_set_clkdiv_int_frac</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint16_t div_int, uint8_t div_frac) {</div>
<div class="line"><a id="l01636" name="l01636"></a><span class="lineno"> 1636</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01637" name="l01637"></a><span class="lineno"> 1637</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01638" name="l01638"></a><span class="lineno"> 1638</span>    invalid_params_if(HARDWARE_PIO, div_int == 0 &amp;&amp; div_frac != 0);</div>
<div class="line"><a id="l01639" name="l01639"></a><span class="lineno"> 1639</span>    pio-&gt;sm[sm].clkdiv =</div>
<div class="line"><a id="l01640" name="l01640"></a><span class="lineno"> 1640</span>            (((uint)div_frac) &lt;&lt; PIO_SM0_CLKDIV_FRAC_LSB) |</div>
<div class="line"><a id="l01641" name="l01641"></a><span class="lineno"> 1641</span>            (((uint)div_int) &lt;&lt; PIO_SM0_CLKDIV_INT_LSB);</div>
<div class="line"><a id="l01642" name="l01642"></a><span class="lineno"> 1642</span>}</div>
<div class="line"><a id="l01643" name="l01643"></a><span class="lineno"> 1643</span> </div>
<div class="line"><a id="l01651" name="l01651"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga88df92ae6a4ef3320b6565117aca885b"> 1651</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga88df92ae6a4ef3320b6565117aca885b">pio_sm_set_clkdiv</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, <span class="keywordtype">float</span> div) {</div>
<div class="line"><a id="l01652" name="l01652"></a><span class="lineno"> 1652</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01653" name="l01653"></a><span class="lineno"> 1653</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01654" name="l01654"></a><span class="lineno"> 1654</span>    uint16_t div_int;</div>
<div class="line"><a id="l01655" name="l01655"></a><span class="lineno"> 1655</span>    uint8_t div_frac;</div>
<div class="line"><a id="l01656" name="l01656"></a><span class="lineno"> 1656</span>    pio_calculate_clkdiv_from_float(div, &amp;div_int, &amp;div_frac);</div>
<div class="line"><a id="l01657" name="l01657"></a><span class="lineno"> 1657</span>    <a class="code hl_function" href="group__hardware__pio.html#gaa9d1d18a7decd0068b8a2a9159c9fd34">pio_sm_set_clkdiv_int_frac</a>(pio, sm, div_int, div_frac);</div>
<div class="line"><a id="l01658" name="l01658"></a><span class="lineno"> 1658</span>}</div>
<div class="line"><a id="l01659" name="l01659"></a><span class="lineno"> 1659</span> </div>
<div class="line"><a id="l01666" name="l01666"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gab4cb36e85ee8807b51fd03021adff9ca"> 1666</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gab4cb36e85ee8807b51fd03021adff9ca">pio_sm_clear_fifos</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm) {</div>
<div class="line"><a id="l01667" name="l01667"></a><span class="lineno"> 1667</span>    <span class="comment">// changing the FIFO join state clears the fifo</span></div>
<div class="line"><a id="l01668" name="l01668"></a><span class="lineno"> 1668</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01669" name="l01669"></a><span class="lineno"> 1669</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01670" name="l01670"></a><span class="lineno"> 1670</span>    <a class="code hl_function" href="group__hardware__base.html#ga643ecd2ac7ab82d2e1f04dba42135f2b">hw_xor_bits</a>(&amp;pio-&gt;sm[sm].shiftctrl, PIO_SM0_SHIFTCTRL_FJOIN_RX_BITS);</div>
<div class="line"><a id="l01671" name="l01671"></a><span class="lineno"> 1671</span>    <a class="code hl_function" href="group__hardware__base.html#ga643ecd2ac7ab82d2e1f04dba42135f2b">hw_xor_bits</a>(&amp;pio-&gt;sm[sm].shiftctrl, PIO_SM0_SHIFTCTRL_FJOIN_RX_BITS);</div>
<div class="line"><a id="l01672" name="l01672"></a><span class="lineno"> 1672</span>}</div>
<div class="line"><a id="l01673" name="l01673"></a><span class="lineno"> 1673</span> </div>
<div class="line"><a id="l01686" name="l01686"></a><span class="lineno"> 1686</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga1286f306263b413a8002c9db2b433d8b">pio_sm_set_pins</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint32_t pin_values);</div>
<div class="line"><a id="l01687" name="l01687"></a><span class="lineno"> 1687</span> </div>
<div class="line"><a id="l01701" name="l01701"></a><span class="lineno"> 1701</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga963167ca42f67f79ec5de6b47d6027d5">pio_sm_set_pins_with_mask</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint32_t pin_values, uint32_t pin_mask);</div>
<div class="line"><a id="l01702" name="l01702"></a><span class="lineno"> 1702</span> </div>
<div class="line"><a id="l01716" name="l01716"></a><span class="lineno"> 1716</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga8269f1ef4cb1e4b3b957d5f1fa6fc623">pio_sm_set_pindirs_with_mask</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint32_t pin_dirs, uint32_t pin_mask);</div>
<div class="line"><a id="l01717" name="l01717"></a><span class="lineno"> 1717</span> </div>
<div class="line"><a id="l01733" name="l01733"></a><span class="lineno"> 1733</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__pio.html#gaf5c965ef1ca21684630c8be2cf3e52e7">pio_sm_set_consecutive_pindirs</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint pins_base, uint pin_count, <span class="keywordtype">bool</span> is_out);</div>
<div class="line"><a id="l01734" name="l01734"></a><span class="lineno"> 1734</span> </div>
<div class="line"><a id="l01745" name="l01745"></a><span class="lineno"> 1745</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gaa75bc8b2060929ec2b2599da8081a99b">pio_sm_claim</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm);</div>
<div class="line"><a id="l01746" name="l01746"></a><span class="lineno"> 1746</span> </div>
<div class="line"><a id="l01757" name="l01757"></a><span class="lineno"> 1757</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga4c25ad61f15a76499997102e126cbdfd">pio_claim_sm_mask</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm_mask);</div>
<div class="line"><a id="l01758" name="l01758"></a><span class="lineno"> 1758</span> </div>
<div class="line"><a id="l01767" name="l01767"></a><span class="lineno"> 1767</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#ga62328112de918932e4ed0955ce0054ab">pio_sm_unclaim</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm);</div>
<div class="line"><a id="l01768" name="l01768"></a><span class="lineno"> 1768</span> </div>
<div class="line"><a id="l01777" name="l01777"></a><span class="lineno"> 1777</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__pio.html#ga604c071438065c46c9f4f21bdb61befd">pio_claim_unused_sm</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, <span class="keywordtype">bool</span> required);</div>
<div class="line"><a id="l01778" name="l01778"></a><span class="lineno"> 1778</span> </div>
<div class="line"><a id="l01788" name="l01788"></a><span class="lineno"> 1788</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#ga699fb7272e3cb5ab76a84fbf3640325d">pio_sm_is_claimed</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm);</div>
<div class="line"><a id="l01789" name="l01789"></a><span class="lineno"> 1789</span> </div>
<div class="line"><a id="l01800" name="l01800"></a><span class="lineno"> 1800</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#ga03abf744baa28e22a46fcf81452c47cf">pio_claim_free_sm_and_add_program</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program, <a class="code hl_struct" href="structpio__hw__t.html">PIO</a> *pio, uint *sm, uint *offset);</div>
<div class="line"><a id="l01801" name="l01801"></a><span class="lineno"> 1801</span> </div>
<div class="line"><a id="l01824" name="l01824"></a><span class="lineno"> 1824</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__pio.html#ga53c3bbe939b3c58585d0e19ffe91e18e">pio_claim_free_sm_and_add_program_for_gpio_range</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program, <a class="code hl_struct" href="structpio__hw__t.html">PIO</a> *pio, uint *sm, uint *offset, uint gpio_base, uint gpio_count, <span class="keywordtype">bool</span> set_gpio_base);</div>
<div class="line"><a id="l01825" name="l01825"></a><span class="lineno"> 1825</span> </div>
<div class="line"><a id="l01835" name="l01835"></a><span class="lineno"> 1835</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__pio.html#gaa8178ef68166e58260da3989bc5f06bd">pio_remove_program_and_unclaim_sm</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structpio__program.html">pio_program_t</a> *program, <a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint sm, uint offset);</div>
<div class="line"><a id="l01836" name="l01836"></a><span class="lineno"> 1836</span> </div>
<div class="line"><a id="l01844" name="l01844"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga29b350d20174699f5594fc46a35ca699"> 1844</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__pio.html#ga29b350d20174699f5594fc46a35ca699">pio_get_irq_num</a>(<a class="code hl_struct" href="structpio__hw__t.html">PIO</a> pio, uint irqn) {</div>
<div class="line"><a id="l01845" name="l01845"></a><span class="lineno"> 1845</span>    check_pio_param(pio);</div>
<div class="line"><a id="l01846" name="l01846"></a><span class="lineno"> 1846</span>    valid_params_if(HARDWARE_PIO, irqn &lt; NUM_PIO_IRQS);</div>
<div class="line"><a id="l01847" name="l01847"></a><span class="lineno"> 1847</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__pio.html#gaeb939c4541517980acf9de3ae4010624">PIO_IRQ_NUM</a>(pio, irqn);</div>
<div class="line"><a id="l01848" name="l01848"></a><span class="lineno"> 1848</span>}</div>
<div class="line"><a id="l01849" name="l01849"></a><span class="lineno"> 1849</span> </div>
<div class="line"><a id="l01856" name="l01856"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#ga89d26de56d58a6a1022dba7f21e84b4e"> 1856</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a> <a class="code hl_function" href="group__hardware__pio.html#ga89d26de56d58a6a1022dba7f21e84b4e">pio_get_tx_fifo_not_full_interrupt_source</a>(uint sm) {</div>
<div class="line"><a id="l01857" name="l01857"></a><span class="lineno"> 1857</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01858" name="l01858"></a><span class="lineno"> 1858</span>    <span class="keywordflow">return</span> ((<a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a>)(<a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca924b2a1d4b6d257ac13608729dcf9ee1">pis_sm0_tx_fifo_not_full</a> + sm));</div>
<div class="line"><a id="l01859" name="l01859"></a><span class="lineno"> 1859</span>}</div>
<div class="line"><a id="l01860" name="l01860"></a><span class="lineno"> 1860</span> </div>
<div class="line"><a id="l01867" name="l01867"></a><span class="lineno"><a class="line" href="group__hardware__pio.html#gad821de9c14a966fc5c16321ed5df92b4"> 1867</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a> <a class="code hl_function" href="group__hardware__pio.html#gad821de9c14a966fc5c16321ed5df92b4">pio_get_rx_fifo_not_empty_interrupt_source</a>(uint sm) {</div>
<div class="line"><a id="l01868" name="l01868"></a><span class="lineno"> 1868</span>    check_sm_param(sm);</div>
<div class="line"><a id="l01869" name="l01869"></a><span class="lineno"> 1869</span>    <span class="keywordflow">return</span> ((<a class="code hl_typedef" href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a>)(<a class="code hl_enumvalue" href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca959e0b9e484719a0af543fb87a365d52">pis_sm0_rx_fifo_not_empty</a> + sm));</div>
<div class="line"><a id="l01870" name="l01870"></a><span class="lineno"> 1870</span>}</div>
<div class="line"><a id="l01871" name="l01871"></a><span class="lineno"> 1871</span> </div>
<div class="line"><a id="l01872" name="l01872"></a><span class="lineno"> 1872</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l01873" name="l01873"></a><span class="lineno"> 1873</span>}</div>
<div class="line"><a id="l01874" name="l01874"></a><span class="lineno"> 1874</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l01875" name="l01875"></a><span class="lineno"> 1875</span> </div>
<div class="line"><a id="l01876" name="l01876"></a><span class="lineno"> 1876</span><span class="preprocessor">#endif </span><span class="comment">// _PIO_H_</span></div>
<div class="ttc" id="aaddress__mapped_8h_html"><div class="ttname"><a href="address__mapped_8h.html">address_mapped.h</a></div></div>
<div class="ttc" id="agpio_8h_html"><div class="ttname"><a href="gpio_8h.html">gpio.h</a></div></div>
<div class="ttc" id="agroup__hardware__base_html_ga625e737a57f12211cf1f634ca5095ae4"><div class="ttname"><a href="group__hardware__base.html#ga625e737a57f12211cf1f634ca5095ae4">hw_set_bits</a></div><div class="ttdeci">static __force_inline void hw_set_bits(io_rw_32 *addr, uint32_t mask)</div><div class="ttdoc">Atomically set the specified bits to 1 in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:135</div></div>
<div class="ttc" id="agroup__hardware__base_html_ga643ecd2ac7ab82d2e1f04dba42135f2b"><div class="ttname"><a href="group__hardware__base.html#ga643ecd2ac7ab82d2e1f04dba42135f2b">hw_xor_bits</a></div><div class="ttdeci">static __force_inline void hw_xor_bits(io_rw_32 *addr, uint32_t mask)</div><div class="ttdoc">Atomically flip the specified bits in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:155</div></div>
<div class="ttc" id="agroup__hardware__base_html_gafd1c089df868d987daf95870b501c2ed"><div class="ttname"><a href="group__hardware__base.html#gafd1c089df868d987daf95870b501c2ed">hw_clear_bits</a></div><div class="ttdeci">static __force_inline void hw_clear_bits(io_rw_32 *addr, uint32_t mask)</div><div class="ttdoc">Atomically clear the specified bits to 0 in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:145</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014a156b1b999c6b2dd877545c8c79060a30"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a156b1b999c6b2dd877545c8c79060a30">DREQ_PIO0_TX3</a></div><div class="ttdeci">@ DREQ_PIO0_TX3</div><div class="ttdoc">Select PIO0's TX FIFO 3 as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:85</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014a3c22f2c9eb4a49654bba70dbc99bc893"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a3c22f2c9eb4a49654bba70dbc99bc893">DREQ_PIO1_TX0</a></div><div class="ttdeci">@ DREQ_PIO1_TX0</div><div class="ttdoc">Select PIO1's TX FIFO 0 as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:90</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014a833bfa99e8b74de9bfc1872958a742e3"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a833bfa99e8b74de9bfc1872958a742e3">DREQ_PIO1_RX0</a></div><div class="ttdeci">@ DREQ_PIO1_RX0</div><div class="ttdoc">Select PIO1's RX FIFO 0 as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:94</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014aa2e360dbf123d634d08e5fae27aa29e5"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014aa2e360dbf123d634d08e5fae27aa29e5">DREQ_PIO0_TX2</a></div><div class="ttdeci">@ DREQ_PIO0_TX2</div><div class="ttdoc">Select PIO0's TX FIFO 2 as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:84</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014ac4bc12d74b758a7b39c1977c401e2fe1"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ac4bc12d74b758a7b39c1977c401e2fe1">DREQ_PIO0_RX0</a></div><div class="ttdeci">@ DREQ_PIO0_RX0</div><div class="ttdoc">Select PIO0's RX FIFO 0 as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:86</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014ac5fedec084064e1d9ff9c6a382c1ccf8"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ac5fedec084064e1d9ff9c6a382c1ccf8">DREQ_PIO0_TX1</a></div><div class="ttdeci">@ DREQ_PIO0_TX1</div><div class="ttdoc">Select PIO0's TX FIFO 1 as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:83</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014ad7529b7e45af2d7eab4b740ff15b49d8"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ad7529b7e45af2d7eab4b740ff15b49d8">DREQ_PIO0_TX0</a></div><div class="ttdeci">@ DREQ_PIO0_TX0</div><div class="ttdoc">Select PIO0's TX FIFO 0 as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:82</div></div>
<div class="ttc" id="agroup__hardware__gpio_html_ga22f6b90c4c7e0013b4b5341de0a44fc4"><div class="ttname"><a href="group__hardware__gpio.html#ga22f6b90c4c7e0013b4b5341de0a44fc4">gpio_set_function</a></div><div class="ttdeci">void gpio_set_function(uint gpio, gpio_function_t fn)</div><div class="ttdoc">Select GPIO function.</div><div class="ttdef"><b>Definition:</b> gpio.c:38</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga009b3f44f112208114972c32546dfddb"><div class="ttname"><a href="group__hardware__pio.html#ga009b3f44f112208114972c32546dfddb">pio_sm_get_tx_fifo_level</a></div><div class="ttdeci">static uint pio_sm_get_tx_fifo_level(PIO pio, uint sm)</div><div class="ttdoc">Return the number of elements currently in a state machine's TX FIFO.</div><div class="ttdef"><b>Definition:</b> pio.h:1577</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga03abf744baa28e22a46fcf81452c47cf"><div class="ttname"><a href="group__hardware__pio.html#ga03abf744baa28e22a46fcf81452c47cf">pio_claim_free_sm_and_add_program</a></div><div class="ttdeci">bool pio_claim_free_sm_and_add_program(const pio_program_t *program, PIO *pio, uint *sm, uint *offset)</div><div class="ttdoc">Finds a PIO and statemachine and adds a program into PIO memory.</div><div class="ttdef"><b>Definition:</b> pio.c:331</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga06134c14db82b7927d96faeb07ab0e8b"><div class="ttname"><a href="group__hardware__pio.html#ga06134c14db82b7927d96faeb07ab0e8b">PIO_INSTANCE</a></div><div class="ttdeci">#define PIO_INSTANCE(instance)</div><div class="ttdoc">Returns the PIO instance with the given PIO number.</div><div class="ttdef"><b>Definition:</b> pio.h:157</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga06d0fd918247a86e8394afac67cf6992"><div class="ttname"><a href="group__hardware__pio.html#ga06d0fd918247a86e8394afac67cf6992">pio_set_irqn_source_enabled</a></div><div class="ttdeci">static void pio_set_irqn_source_enabled(PIO pio, uint irq_index, pio_interrupt_source_t source, bool enabled)</div><div class="ttdoc">Enable/Disable a single source on a PIO's specified (0/1) IRQ index.</div><div class="ttdef"><b>Definition:</b> pio.h:1219</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga0e60c768ea29f296b5ef40c02211bbcc"><div class="ttname"><a href="group__hardware__pio.html#ga0e60c768ea29f296b5ef40c02211bbcc">pio_interrupt_source</a></div><div class="ttdeci">pio_interrupt_source</div><div class="ttdoc">PIO interrupt source numbers for pio related IRQs.</div><div class="ttdef"><b>Definition:</b> pio.h:1124</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga12650f49c110cb1bfd8092ab67210885"><div class="ttname"><a href="group__hardware__pio.html#ga12650f49c110cb1bfd8092ab67210885">pio_sm_get_blocking</a></div><div class="ttdeci">static uint32_t pio_sm_get_blocking(PIO pio, uint sm)</div><div class="ttdoc">Read a word of data from a state machine's RX FIFO, blocking if the FIFO is empty.</div><div class="ttdef"><b>Definition:</b> pio.h:1605</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga1286f306263b413a8002c9db2b433d8b"><div class="ttname"><a href="group__hardware__pio.html#ga1286f306263b413a8002c9db2b433d8b">pio_sm_set_pins</a></div><div class="ttdeci">void pio_sm_set_pins(PIO pio, uint sm, uint32_t pin_values)</div><div class="ttdoc">Use a state machine to set a value on all pins for the PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.c:212</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga12948478935f817218b64e1db3a8ebad"><div class="ttname"><a href="group__hardware__pio.html#ga12948478935f817218b64e1db3a8ebad">pio_add_program_at_offset</a></div><div class="ttdeci">int pio_add_program_at_offset(PIO pio, const pio_program_t *program, uint offset)</div><div class="ttdoc">Attempt to load the program at the specified instruction memory offset.</div><div class="ttdef"><b>Definition:</b> pio.c:183</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga151f87205041da11d3c69be5ddbd5653"><div class="ttname"><a href="group__hardware__pio.html#ga151f87205041da11d3c69be5ddbd5653">pio_get_instance</a></div><div class="ttdeci">static PIO pio_get_instance(uint instance)</div><div class="ttdoc">Convert PIO instance to hardware instance.</div><div class="ttdef"><b>Definition:</b> pio.h:742</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga1bf1b296713b76e19b87b59b84136b2c"><div class="ttname"><a href="group__hardware__pio.html#ga1bf1b296713b76e19b87b59b84136b2c">pio_sm_exec_wait_blocking</a></div><div class="ttdeci">static void pio_sm_exec_wait_blocking(PIO pio, uint sm, uint instr)</div><div class="ttdoc">Immediately execute an instruction on a state machine and wait for it to complete.</div><div class="ttdef"><b>Definition:</b> pio.h:1328</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga28e9a84f3332ebf088f665d4b676117b"><div class="ttname"><a href="group__hardware__pio.html#ga28e9a84f3332ebf088f665d4b676117b">pio_sm_set_config</a></div><div class="ttdeci">static int pio_sm_set_config(PIO pio, uint sm, const pio_sm_config *config)</div><div class="ttdoc">Apply a state machine configuration to a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:688</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga29b350d20174699f5594fc46a35ca699"><div class="ttname"><a href="group__hardware__pio.html#ga29b350d20174699f5594fc46a35ca699">pio_get_irq_num</a></div><div class="ttdeci">static int pio_get_irq_num(PIO pio, uint irqn)</div><div class="ttdoc">Return an IRQ for a PIO hardware instance.</div><div class="ttdef"><b>Definition:</b> pio.h:1844</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga332210f0e594b24bf64f4bb1c8f49be3"><div class="ttname"><a href="group__hardware__pio.html#ga332210f0e594b24bf64f4bb1c8f49be3">pio_set_gpio_base</a></div><div class="ttdeci">int pio_set_gpio_base(PIO pio, uint gpio_base)</div><div class="ttdoc">Set the base GPIO base for the PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.c:97</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga356b3f4974cd31fdc4a2de381aceea5e"><div class="ttname"><a href="group__hardware__pio.html#ga356b3f4974cd31fdc4a2de381aceea5e">pio_mov_status_type</a></div><div class="ttdeci">pio_mov_status_type</div><div class="ttdoc">MOV status types.</div><div class="ttdef"><b>Definition:</b> pio.h:91</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga3dbf64343a2fba75549ee7b0351f7e52"><div class="ttname"><a href="group__hardware__pio.html#ga3dbf64343a2fba75549ee7b0351f7e52">pio_sm_is_tx_fifo_full</a></div><div class="ttdeci">static bool pio_sm_is_tx_fifo_full(PIO pio, uint sm)</div><div class="ttdoc">Determine if a state machine's TX FIFO is full.</div><div class="ttdef"><b>Definition:</b> pio.h:1551</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga4091eef7afda5200a3988b9412fe3b3f"><div class="ttname"><a href="group__hardware__pio.html#ga4091eef7afda5200a3988b9412fe3b3f">pio_get_dreq</a></div><div class="ttdeci">static uint pio_get_dreq(PIO pio, uint sm, bool is_tx)</div><div class="ttdoc">Return the DREQ to use for pacing transfers to/from a particular state machine FIFO.</div><div class="ttdef"><b>Definition:</b> pio.h:772</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga4369e665ee8d2db58a83eccad65c917c"><div class="ttname"><a href="group__hardware__pio.html#ga4369e665ee8d2db58a83eccad65c917c">pio_set_irq1_source_enabled</a></div><div class="ttdeci">static void pio_set_irq1_source_enabled(PIO pio, pio_interrupt_source_t source, bool enabled)</div><div class="ttdoc">Enable/Disable a single source on a PIO's IRQ 1.</div><div class="ttdef"><b>Definition:</b> pio.h:1168</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga46af88f03a0c5abe4d55d45c5b2ccfb7"><div class="ttname"><a href="group__hardware__pio.html#ga46af88f03a0c5abe4d55d45c5b2ccfb7">pio_sm_drain_tx_fifo</a></div><div class="ttdeci">void pio_sm_drain_tx_fifo(PIO pio, uint sm)</div><div class="ttdoc">Empty out a state machine's TX FIFO.</div><div class="ttdef"><b>Definition:</b> pio.c:323</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga4c25ad61f15a76499997102e126cbdfd"><div class="ttname"><a href="group__hardware__pio.html#ga4c25ad61f15a76499997102e126cbdfd">pio_claim_sm_mask</a></div><div class="ttdeci">void pio_claim_sm_mask(PIO pio, uint sm_mask)</div><div class="ttdoc">Mark multiple state machines as used.</div><div class="ttdef"><b>Definition:</b> pio.c:36</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga53c3bbe939b3c58585d0e19ffe91e18e"><div class="ttname"><a href="group__hardware__pio.html#ga53c3bbe939b3c58585d0e19ffe91e18e">pio_claim_free_sm_and_add_program_for_gpio_range</a></div><div class="ttdeci">bool pio_claim_free_sm_and_add_program_for_gpio_range(const pio_program_t *program, PIO *pio, uint *sm, uint *offset, uint gpio_base, uint gpio_count, bool set_gpio_base)</div><div class="ttdoc">Finds a PIO and statemachine and adds a program into PIO memory.</div><div class="ttdef"><b>Definition:</b> pio.c:335</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga604c071438065c46c9f4f21bdb61befd"><div class="ttname"><a href="group__hardware__pio.html#ga604c071438065c46c9f4f21bdb61befd">pio_claim_unused_sm</a></div><div class="ttdeci">int pio_claim_unused_sm(PIO pio, bool required)</div><div class="ttdoc">Claim a free state machine on a PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.c:48</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga62328112de918932e4ed0955ce0054ab"><div class="ttname"><a href="group__hardware__pio.html#ga62328112de918932e4ed0955ce0054ab">pio_sm_unclaim</a></div><div class="ttdeci">void pio_sm_unclaim(PIO pio, uint sm)</div><div class="ttdoc">Mark a state machine as no longer used.</div><div class="ttdef"><b>Definition:</b> pio.c:42</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga63e13f639ae50ee9cb8afeceba6bb118"><div class="ttname"><a href="group__hardware__pio.html#ga63e13f639ae50ee9cb8afeceba6bb118">pio_clkdiv_restart_sm_mask</a></div><div class="ttdeci">static void pio_clkdiv_restart_sm_mask(PIO pio, uint32_t mask)</div><div class="ttdoc">Restart multiple state machines' clock dividers from a phase of 0.</div><div class="ttdef"><b>Definition:</b> pio.h:1027</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga699fb7272e3cb5ab76a84fbf3640325d"><div class="ttname"><a href="group__hardware__pio.html#ga699fb7272e3cb5ab76a84fbf3640325d">pio_sm_is_claimed</a></div><div class="ttdeci">bool pio_sm_is_claimed(PIO pio, uint sm)</div><div class="ttdoc">Determine if a PIO state machine is claimed.</div><div class="ttdef"><b>Definition:</b> pio.c:57</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga6f650eb98640eac2346ff26b46dc378b"><div class="ttname"><a href="group__hardware__pio.html#ga6f650eb98640eac2346ff26b46dc378b">pio_interrupt_clear</a></div><div class="ttdeci">static void pio_interrupt_clear(PIO pio, uint pio_interrupt_num)</div><div class="ttdoc">Clear a particular PIO interrupt.</div><div class="ttdef"><b>Definition:</b> pio.h:1266</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga6fe6273d63665fdb16964790d55709fa"><div class="ttname"><a href="group__hardware__pio.html#ga6fe6273d63665fdb16964790d55709fa">pio_sm_get</a></div><div class="ttdeci">static uint32_t pio_sm_get(PIO pio, uint sm)</div><div class="ttdoc">Read a word of data from a state machine's RX FIFO.</div><div class="ttdef"><b>Definition:</b> pio.h:1497</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga71e388315eb6a77a6560b77ec13145a4"><div class="ttname"><a href="group__hardware__pio.html#ga71e388315eb6a77a6560b77ec13145a4">pio_sm_is_rx_fifo_full</a></div><div class="ttdeci">static bool pio_sm_is_rx_fifo_full(PIO pio, uint sm)</div><div class="ttdoc">Determine if a state machine's RX FIFO is full.</div><div class="ttdef"><b>Definition:</b> pio.h:1510</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga74a681208957ab2bc8c8aafff9bb9f7c"><div class="ttname"><a href="group__hardware__pio.html#ga74a681208957ab2bc8c8aafff9bb9f7c">pio_sm_set_wrap</a></div><div class="ttdeci">static void pio_sm_set_wrap(PIO pio, uint sm, uint wrap_target, uint wrap)</div><div class="ttdoc">Set the current wrap configuration for a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1344</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga79fcbff988c01df8285f05ce6ad3a86d"><div class="ttname"><a href="group__hardware__pio.html#ga79fcbff988c01df8285f05ce6ad3a86d">PIO_NUM</a></div><div class="ttdeci">#define PIO_NUM(pio)</div><div class="ttdoc">Returns the PIO number for a PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.h:144</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga7b89b93dd0553c77538c70baf6a7e4f0"><div class="ttname"><a href="group__hardware__pio.html#ga7b89b93dd0553c77538c70baf6a7e4f0">pio_sm_restart</a></div><div class="ttdeci">static void pio_sm_restart(PIO pio, uint sm)</div><div class="ttdoc">Restart a state machine with a known state.</div><div class="ttdef"><b>Definition:</b> pio.h:950</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga7d415b966abbc1c25315d0775d093356"><div class="ttname"><a href="group__hardware__pio.html#ga7d415b966abbc1c25315d0775d093356">pio_fifo_join</a></div><div class="ttdeci">pio_fifo_join</div><div class="ttdoc">FIFO join states.</div><div class="ttdef"><b>Definition:</b> pio.h:77</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga7f0190e662c5b6e24d91044b42010ffc"><div class="ttname"><a href="group__hardware__pio.html#ga7f0190e662c5b6e24d91044b42010ffc">pio_sm_set_out_pins</a></div><div class="ttdeci">static void pio_sm_set_out_pins(PIO pio, uint sm, uint out_base, uint out_count)</div><div class="ttdoc">Set the current 'out' pins for a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1365</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga800d8949b5d04dfe635d4c12241f0cd2"><div class="ttname"><a href="group__hardware__pio.html#ga800d8949b5d04dfe635d4c12241f0cd2">pio_sm_exec</a></div><div class="ttdeci">static void pio_sm_exec(PIO pio, uint sm, uint instr)</div><div class="ttdoc">Immediately execute an instruction on a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1297</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga81259bc71fd3bd81b96e47f9f4ea7b67"><div class="ttname"><a href="group__hardware__pio.html#ga81259bc71fd3bd81b96e47f9f4ea7b67">pio_set_irq0_source_mask_enabled</a></div><div class="ttdeci">static void pio_set_irq0_source_mask_enabled(PIO pio, uint32_t source_mask, bool enabled)</div><div class="ttdoc">Enable/Disable multiple sources on a PIO's IRQ 0.</div><div class="ttdef"><b>Definition:</b> pio.h:1184</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga81c77d31aff72655977b658a9c37665e"><div class="ttname"><a href="group__hardware__pio.html#ga81c77d31aff72655977b658a9c37665e">pio_remove_program</a></div><div class="ttdeci">void pio_remove_program(PIO pio, const pio_program_t *program, uint loaded_offset)</div><div class="ttdoc">Remove a program from a PIO instance's instruction memory.</div><div class="ttdef"><b>Definition:</b> pio.c:190</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga8269f1ef4cb1e4b3b957d5f1fa6fc623"><div class="ttname"><a href="group__hardware__pio.html#ga8269f1ef4cb1e4b3b957d5f1fa6fc623">pio_sm_set_pindirs_with_mask</a></div><div class="ttdeci">void pio_sm_set_pindirs_with_mask(PIO pio, uint sm, uint32_t pin_dirs, uint32_t pin_mask)</div><div class="ttdoc">Use a state machine to set the pin directions for multiple pins for the PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.c:252</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga850396a2a2925bbcc97247a629ca5bd2"><div class="ttname"><a href="group__hardware__pio.html#ga850396a2a2925bbcc97247a629ca5bd2">pio_clear_instruction_memory</a></div><div class="ttdeci">void pio_clear_instruction_memory(PIO pio)</div><div class="ttdoc">Clears all of a PIO instance's instruction memory.</div><div class="ttdef"><b>Definition:</b> pio.c:199</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga87cb36afe5783e2e92bf528b1d50ea07"><div class="ttname"><a href="group__hardware__pio.html#ga87cb36afe5783e2e92bf528b1d50ea07">pio_sm_set_sideset_pins</a></div><div class="ttdeci">static void pio_sm_set_sideset_pins(PIO pio, uint sm, uint sideset_base)</div><div class="ttdoc">Set the current 'sideset' pins for a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1431</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga88df92ae6a4ef3320b6565117aca885b"><div class="ttname"><a href="group__hardware__pio.html#ga88df92ae6a4ef3320b6565117aca885b">pio_sm_set_clkdiv</a></div><div class="ttdeci">static void pio_sm_set_clkdiv(PIO pio, uint sm, float div)</div><div class="ttdoc">set the current clock divider for a state machine</div><div class="ttdef"><b>Definition:</b> pio.h:1651</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga89688fd1a941797cb0cc80dbbc4bbd5f"><div class="ttname"><a href="group__hardware__pio.html#ga89688fd1a941797cb0cc80dbbc4bbd5f">pio_get_gpio_base</a></div><div class="ttdeci">static uint pio_get_gpio_base(PIO pio)</div><div class="ttdoc">Return the base GPIO base for the PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.h:671</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga89d26de56d58a6a1022dba7f21e84b4e"><div class="ttname"><a href="group__hardware__pio.html#ga89d26de56d58a6a1022dba7f21e84b4e">pio_get_tx_fifo_not_full_interrupt_source</a></div><div class="ttdeci">static pio_interrupt_source_t pio_get_tx_fifo_not_full_interrupt_source(uint sm)</div><div class="ttdoc">Return the interrupt source for a state machines TX FIFO not full interrupt.</div><div class="ttdef"><b>Definition:</b> pio.h:1856</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga8fa0b87fde0db10be2934de542f9d6c2"><div class="ttname"><a href="group__hardware__pio.html#ga8fa0b87fde0db10be2934de542f9d6c2">pio_sm_get_rx_fifo_level</a></div><div class="ttdeci">static uint pio_sm_get_rx_fifo_level(PIO pio, uint sm)</div><div class="ttdoc">Return the number of elements currently in a state machine's RX FIFO.</div><div class="ttdef"><b>Definition:</b> pio.h:1536</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga916d05e71da7f2173cd22b46bbfa0a11"><div class="ttname"><a href="group__hardware__pio.html#ga916d05e71da7f2173cd22b46bbfa0a11">pio0</a></div><div class="ttdeci">#define pio0</div><div class="ttdef"><b>Definition:</b> pio.h:107</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga923a261ba19804c404900228e99c9522"><div class="ttname"><a href="group__hardware__pio.html#ga923a261ba19804c404900228e99c9522">pio1</a></div><div class="ttdeci">#define pio1</div><div class="ttdef"><b>Definition:</b> pio.h:115</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga963167ca42f67f79ec5de6b47d6027d5"><div class="ttname"><a href="group__hardware__pio.html#ga963167ca42f67f79ec5de6b47d6027d5">pio_sm_set_pins_with_mask</a></div><div class="ttdeci">void pio_sm_set_pins_with_mask(PIO pio, uint sm, uint32_t pin_values, uint32_t pin_mask)</div><div class="ttdoc">Use a state machine to set a value on multiple pins for the PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.c:234</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga97b135c9016b91fbf237c93313d25fd4"><div class="ttname"><a href="group__hardware__pio.html#ga97b135c9016b91fbf237c93313d25fd4">pio_sm_set_jmp_pin</a></div><div class="ttdeci">static void pio_sm_set_jmp_pin(PIO pio, uint sm, uint pin)</div><div class="ttdoc">Set the 'jmp' pin for a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1450</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga9c0ea409da4fcb98586120b575921c31"><div class="ttname"><a href="group__hardware__pio.html#ga9c0ea409da4fcb98586120b575921c31">pio_sm_get_pc</a></div><div class="ttdeci">static uint8_t pio_sm_get_pc(PIO pio, uint sm)</div><div class="ttdoc">Return the current program counter for a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1279</div></div>
<div class="ttc" id="agroup__hardware__pio_html_ga9e150bfd3d43565a01f38a37fa2884d4"><div class="ttname"><a href="group__hardware__pio.html#ga9e150bfd3d43565a01f38a37fa2884d4">pio_get_funcsel</a></div><div class="ttdeci">static uint pio_get_funcsel(PIO pio)</div><div class="ttdoc">Return the funcsel number of a PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.h:731</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaa26de7b3ef34fb86138bf376ab152577"><div class="ttname"><a href="group__hardware__pio.html#gaa26de7b3ef34fb86138bf376ab152577">PIO_FUNCSEL_NUM</a></div><div class="ttdeci">#define PIO_FUNCSEL_NUM(pio, gpio)</div><div class="ttdoc">Returns gpio_function_t needed to select the PIO function for the given PIO instance on the given GPI...</div><div class="ttdef"><b>Definition:</b> pio.h:169</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaa47ec4090dcdc251e44bf4e4cb89a7bc"><div class="ttname"><a href="group__hardware__pio.html#gaa47ec4090dcdc251e44bf4e4cb89a7bc">pio_sm_set_enabled</a></div><div class="ttdeci">static void pio_sm_set_enabled(PIO pio, uint sm, bool enabled)</div><div class="ttdoc">Enable or disable a PIO state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:888</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaa75bc8b2060929ec2b2599da8081a99b"><div class="ttname"><a href="group__hardware__pio.html#gaa75bc8b2060929ec2b2599da8081a99b">pio_sm_claim</a></div><div class="ttdeci">void pio_sm_claim(PIO pio, uint sm)</div><div class="ttdoc">Mark a state machine as used.</div><div class="ttdef"><b>Definition:</b> pio.c:24</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaa8178ef68166e58260da3989bc5f06bd"><div class="ttname"><a href="group__hardware__pio.html#gaa8178ef68166e58260da3989bc5f06bd">pio_remove_program_and_unclaim_sm</a></div><div class="ttdeci">void pio_remove_program_and_unclaim_sm(const pio_program_t *program, PIO pio, uint sm, uint offset)</div><div class="ttdoc">Removes a program from PIO memory and unclaims the state machine.</div><div class="ttdef"><b>Definition:</b> pio.c:391</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaa8aafe966a46f4de9be59f73cae65a4b"><div class="ttname"><a href="group__hardware__pio.html#gaa8aafe966a46f4de9be59f73cae65a4b">pio_can_add_program</a></div><div class="ttdeci">bool pio_can_add_program(PIO pio, const pio_program_t *program)</div><div class="ttdoc">Determine whether the given program can (at the time of the call) be loaded onto the PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.c:145</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaa92c20b2d08f3b8a6bc35cd602a092e4"><div class="ttname"><a href="group__hardware__pio.html#gaa92c20b2d08f3b8a6bc35cd602a092e4">pio_interrupt_get</a></div><div class="ttdeci">static bool pio_interrupt_get(PIO pio, uint pio_interrupt_num)</div><div class="ttdoc">Determine if a particular PIO interrupt is set.</div><div class="ttdef"><b>Definition:</b> pio.h:1254</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaa9d1d18a7decd0068b8a2a9159c9fd34"><div class="ttname"><a href="group__hardware__pio.html#gaa9d1d18a7decd0068b8a2a9159c9fd34">pio_sm_set_clkdiv_int_frac</a></div><div class="ttdeci">static void pio_sm_set_clkdiv_int_frac(PIO pio, uint sm, uint16_t div_int, uint8_t div_frac)</div><div class="ttdoc">set the current clock divider for a state machine using a 16:8 fraction</div><div class="ttdef"><b>Definition:</b> pio.h:1635</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaaa44e504a2abd8ca2c1ee2db91d0652b"><div class="ttname"><a href="group__hardware__pio.html#gaaa44e504a2abd8ca2c1ee2db91d0652b">pio_sm_is_exec_stalled</a></div><div class="ttdeci">static bool pio_sm_is_exec_stalled(PIO pio, uint sm)</div><div class="ttdoc">Determine if an instruction set by pio_sm_exec() is stalled executing.</div><div class="ttdef"><b>Definition:</b> pio.h:1310</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaafac789d94b0727bb02ea83a8786897f"><div class="ttname"><a href="group__hardware__pio.html#gaafac789d94b0727bb02ea83a8786897f">pio_can_add_program_at_offset</a></div><div class="ttdeci">bool pio_can_add_program_at_offset(PIO pio, const pio_program_t *program, uint offset)</div><div class="ttdoc">Determine whether the given program can (at the time of the call) be loaded onto the PIO instance sta...</div><div class="ttdef"><b>Definition:</b> pio.c:153</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gab48b30da795dcd73b4a998d67a4af235"><div class="ttname"><a href="group__hardware__pio.html#gab48b30da795dcd73b4a998d67a4af235">pio_sm_put</a></div><div class="ttdeci">static void pio_sm_put(PIO pio, uint sm, uint32_t data)</div><div class="ttdoc">Write a word of data to a state machine's TX FIFO.</div><div class="ttdef"><b>Definition:</b> pio.h:1476</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gab4cb36e85ee8807b51fd03021adff9ca"><div class="ttname"><a href="group__hardware__pio.html#gab4cb36e85ee8807b51fd03021adff9ca">pio_sm_clear_fifos</a></div><div class="ttdeci">static void pio_sm_clear_fifos(PIO pio, uint sm)</div><div class="ttdoc">Clear a state machine's TX and RX FIFOs.</div><div class="ttdef"><b>Definition:</b> pio.h:1666</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gab9e9aed4bb165a040415ae342e0902fe"><div class="ttname"><a href="group__hardware__pio.html#gab9e9aed4bb165a040415ae342e0902fe">pio_interrupt_source_t</a></div><div class="ttdeci">enum pio_interrupt_source pio_interrupt_source_t</div><div class="ttdoc">PIO interrupt source numbers for pio related IRQs.</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gab9eca729acb2cebdb1abb7793d0f5bdf"><div class="ttname"><a href="group__hardware__pio.html#gab9eca729acb2cebdb1abb7793d0f5bdf">PIO_DREQ_NUM</a></div><div class="ttdeci">#define PIO_DREQ_NUM(pio, sm, is_tx)</div><div class="ttdoc">Returns the dreq_num_t used for pacing DMA transfers to or from a given state machine's FIFOs on this...</div><div class="ttdef"><b>Definition:</b> pio.h:187</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gac3797a9f7e80606152eb44af9ca96398"><div class="ttname"><a href="group__hardware__pio.html#gac3797a9f7e80606152eb44af9ca96398">pio_enable_sm_mask_in_sync</a></div><div class="ttdeci">static void pio_enable_sm_mask_in_sync(PIO pio, uint32_t mask)</div><div class="ttdoc">Enable multiple PIO state machines synchronizing their clock dividers.</div><div class="ttdef"><b>Definition:</b> pio.h:1086</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gacaf6ee284dc834fbb742d1eef6180e6c"><div class="ttname"><a href="group__hardware__pio.html#gacaf6ee284dc834fbb742d1eef6180e6c">pio_sm_set_set_pins</a></div><div class="ttdeci">static void pio_sm_set_set_pins(PIO pio, uint sm, uint set_base, uint set_count)</div><div class="ttdoc">Set the current 'set' pins for a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1389</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gacd981b2206b02eb1c4573a0f328d7819"><div class="ttname"><a href="group__hardware__pio.html#gacd981b2206b02eb1c4573a0f328d7819">pio_sm_clkdiv_restart</a></div><div class="ttdeci">static void pio_sm_clkdiv_restart(PIO pio, uint sm)</div><div class="ttdoc">Restart a state machine's clock divider from a phase of 0.</div><div class="ttdef"><b>Definition:</b> pio.h:992</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gad821de9c14a966fc5c16321ed5df92b4"><div class="ttname"><a href="group__hardware__pio.html#gad821de9c14a966fc5c16321ed5df92b4">pio_get_rx_fifo_not_empty_interrupt_source</a></div><div class="ttdeci">static pio_interrupt_source_t pio_get_rx_fifo_not_empty_interrupt_source(uint sm)</div><div class="ttdoc">Return the interrupt source for a state machines RX FIFO not empty interrupt.</div><div class="ttdef"><b>Definition:</b> pio.h:1867</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gadf404ba44b7f83e79fd6b57b3e2c89df"><div class="ttname"><a href="group__hardware__pio.html#gadf404ba44b7f83e79fd6b57b3e2c89df">pio_sm_is_rx_fifo_empty</a></div><div class="ttdeci">static bool pio_sm_is_rx_fifo_empty(PIO pio, uint sm)</div><div class="ttdoc">Determine if a state machine's RX FIFO is empty.</div><div class="ttdef"><b>Definition:</b> pio.h:1523</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gadf4ae3f4a334c1dcac1b62b148508bf2"><div class="ttname"><a href="group__hardware__pio.html#gadf4ae3f4a334c1dcac1b62b148508bf2">pio_sm_is_tx_fifo_empty</a></div><div class="ttdeci">static bool pio_sm_is_tx_fifo_empty(PIO pio, uint sm)</div><div class="ttdoc">Determine if a state machine's TX FIFO is empty.</div><div class="ttdef"><b>Definition:</b> pio.h:1564</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gae39150dd6910d2776484526059911b79"><div class="ttname"><a href="group__hardware__pio.html#gae39150dd6910d2776484526059911b79">pio_set_irq1_source_mask_enabled</a></div><div class="ttdeci">static void pio_set_irq1_source_mask_enabled(PIO pio, uint32_t source_mask, bool enabled)</div><div class="ttdoc">Enable/Disable multiple sources on a PIO's IRQ 1.</div><div class="ttdef"><b>Definition:</b> pio.h:1201</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gae3e115fd41d9ac29c7a13b0c213bc2cd"><div class="ttname"><a href="group__hardware__pio.html#gae3e115fd41d9ac29c7a13b0c213bc2cd">pio_restart_sm_mask</a></div><div class="ttdeci">static void pio_restart_sm_mask(PIO pio, uint32_t mask)</div><div class="ttdoc">Restart multiple state machine with a known state.</div><div class="ttdef"><b>Definition:</b> pio.h:965</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gae86f691914b78d66b1394ae94f3f4aa6"><div class="ttname"><a href="group__hardware__pio.html#gae86f691914b78d66b1394ae94f3f4aa6">pio_get_index</a></div><div class="ttdeci">static uint pio_get_index(PIO pio)</div><div class="ttdoc">Return the instance number of a PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.h:719</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaeb939c4541517980acf9de3ae4010624"><div class="ttname"><a href="group__hardware__pio.html#gaeb939c4541517980acf9de3ae4010624">PIO_IRQ_NUM</a></div><div class="ttdeci">#define PIO_IRQ_NUM(pio, irqn)</div><div class="ttdoc">Returns the irq_num_t for processor interrupts from the given PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.h:199</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaee8bfc3409cb8d93cccdeda3961bc377"><div class="ttname"><a href="group__hardware__pio.html#gaee8bfc3409cb8d93cccdeda3961bc377">pio_sm_put_blocking</a></div><div class="ttdeci">static void pio_sm_put_blocking(PIO pio, uint sm, uint32_t data)</div><div class="ttdoc">Write a word of data to a state machine's TX FIFO, blocking if the FIFO is full.</div><div class="ttdef"><b>Definition:</b> pio.h:1592</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaef50ef92f7ea0666dffe939c0b3fd24c"><div class="ttname"><a href="group__hardware__pio.html#gaef50ef92f7ea0666dffe939c0b3fd24c">pio_sm_set_in_pins</a></div><div class="ttdeci">static void pio_sm_set_in_pins(PIO pio, uint sm, uint in_base)</div><div class="ttdoc">Set the current 'in' pins for a state machine.</div><div class="ttdef"><b>Definition:</b> pio.h:1411</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaefbd086e8e96fee073438dac3c20334c"><div class="ttname"><a href="group__hardware__pio.html#gaefbd086e8e96fee073438dac3c20334c">pio_add_program</a></div><div class="ttdeci">int pio_add_program(PIO pio, const pio_program_t *program)</div><div class="ttdoc">Attempt to load the program.</div><div class="ttdef"><b>Definition:</b> pio.c:173</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaf5c965ef1ca21684630c8be2cf3e52e7"><div class="ttname"><a href="group__hardware__pio.html#gaf5c965ef1ca21684630c8be2cf3e52e7">pio_sm_set_consecutive_pindirs</a></div><div class="ttdeci">int pio_sm_set_consecutive_pindirs(PIO pio, uint sm, uint pins_base, uint pin_count, bool is_out)</div><div class="ttdoc">Use a state machine to set the same pin direction for multiple consecutive pins for the PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.c:270</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gaf726f77ee21f5373cadf064a4e0b4935"><div class="ttname"><a href="group__hardware__pio.html#gaf726f77ee21f5373cadf064a4e0b4935">pio_set_sm_mask_enabled</a></div><div class="ttdeci">static void pio_set_sm_mask_enabled(PIO pio, uint32_t mask, bool enabled)</div><div class="ttdoc">Enable or disable multiple PIO state machines.</div><div class="ttdef"><b>Definition:</b> pio.h:907</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gafa244b1be8f53a329db9d26298e054bb"><div class="ttname"><a href="group__hardware__pio.html#gafa244b1be8f53a329db9d26298e054bb">pio_gpio_init</a></div><div class="ttdeci">static void pio_gpio_init(PIO pio, uint pin)</div><div class="ttdoc">Setup the function select for a GPIO to use output from the given PIO instance.</div><div class="ttdef"><b>Definition:</b> pio.h:759</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gafc173eb3cb980ed3c823384e42e265bb"><div class="ttname"><a href="group__hardware__pio.html#gafc173eb3cb980ed3c823384e42e265bb">pio_set_irqn_source_mask_enabled</a></div><div class="ttdeci">static void pio_set_irqn_source_mask_enabled(PIO pio, uint irq_index, uint32_t source_mask, bool enabled)</div><div class="ttdoc">Enable/Disable multiple sources on a PIO's specified (0/1) IRQ index.</div><div class="ttdef"><b>Definition:</b> pio.h:1236</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gafe39a664c508e08ef4c74b7c3c38bc07"><div class="ttname"><a href="group__hardware__pio.html#gafe39a664c508e08ef4c74b7c3c38bc07">pio_set_irq0_source_enabled</a></div><div class="ttdeci">static void pio_set_irq0_source_enabled(PIO pio, pio_interrupt_source_t source, bool enabled)</div><div class="ttdoc">Enable/Disable a single source on a PIO's IRQ 0.</div><div class="ttdef"><b>Definition:</b> pio.h:1152</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca066e1cafa42ed6638c93cc09c9b1a0d4"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca066e1cafa42ed6638c93cc09c9b1a0d4">pis_interrupt2</a></div><div class="ttdeci">@ pis_interrupt2</div><div class="ttdoc">PIO interrupt 2 is raised.</div><div class="ttdef"><b>Definition:</b> pio.h:1127</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca214d3bdb6ebc516c4094c4eb476d514d"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca214d3bdb6ebc516c4094c4eb476d514d">pis_sm2_tx_fifo_not_full</a></div><div class="ttdeci">@ pis_sm2_tx_fifo_not_full</div><div class="ttdoc">State machine 2 TX FIFO is not full.</div><div class="ttdef"><b>Definition:</b> pio.h:1137</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca23610bee821f3f8fecbfad0e48c6d742"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca23610bee821f3f8fecbfad0e48c6d742">pis_interrupt0</a></div><div class="ttdeci">@ pis_interrupt0</div><div class="ttdoc">PIO interrupt 0 is raised.</div><div class="ttdef"><b>Definition:</b> pio.h:1125</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca27452b43a8d5d40ab0ba25a195681d48"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca27452b43a8d5d40ab0ba25a195681d48">pis_sm1_tx_fifo_not_full</a></div><div class="ttdeci">@ pis_sm1_tx_fifo_not_full</div><div class="ttdoc">State machine 1 TX FIFO is not full.</div><div class="ttdef"><b>Definition:</b> pio.h:1136</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca463c09bec3151921a18be2c548e97297"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca463c09bec3151921a18be2c548e97297">pis_sm3_tx_fifo_not_full</a></div><div class="ttdeci">@ pis_sm3_tx_fifo_not_full</div><div class="ttdoc">State machine 3 TX FIFO is not full.</div><div class="ttdef"><b>Definition:</b> pio.h:1138</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca6cd394d2b05ae5eec188d5283d16dc49"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca6cd394d2b05ae5eec188d5283d16dc49">pis_interrupt1</a></div><div class="ttdeci">@ pis_interrupt1</div><div class="ttdoc">PIO interrupt 1 is raised.</div><div class="ttdef"><b>Definition:</b> pio.h:1126</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca6d7f4a904cb634fd3f30f033874393ac"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca6d7f4a904cb634fd3f30f033874393ac">pis_sm2_rx_fifo_not_empty</a></div><div class="ttdeci">@ pis_sm2_rx_fifo_not_empty</div><div class="ttdoc">State machine 2 RX FIFO is not empty.</div><div class="ttdef"><b>Definition:</b> pio.h:1141</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca85ee2774a8e5dfaf61d3866a81cb381c"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca85ee2774a8e5dfaf61d3866a81cb381c">pis_sm1_rx_fifo_not_empty</a></div><div class="ttdeci">@ pis_sm1_rx_fifo_not_empty</div><div class="ttdoc">State machine 1 RX FIFO is not empty.</div><div class="ttdef"><b>Definition:</b> pio.h:1140</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca924b2a1d4b6d257ac13608729dcf9ee1"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca924b2a1d4b6d257ac13608729dcf9ee1">pis_sm0_tx_fifo_not_full</a></div><div class="ttdeci">@ pis_sm0_tx_fifo_not_full</div><div class="ttdoc">State machine 0 TX FIFO is not full.</div><div class="ttdef"><b>Definition:</b> pio.h:1135</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca94cf23106019a84873d6db52d1e8470f"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca94cf23106019a84873d6db52d1e8470f">pis_interrupt3</a></div><div class="ttdeci">@ pis_interrupt3</div><div class="ttdoc">PIO interrupt 3 is raised.</div><div class="ttdef"><b>Definition:</b> pio.h:1128</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbcca959e0b9e484719a0af543fb87a365d52"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbcca959e0b9e484719a0af543fb87a365d52">pis_sm0_rx_fifo_not_empty</a></div><div class="ttdeci">@ pis_sm0_rx_fifo_not_empty</div><div class="ttdoc">State machine 0 RX FIFO is not empty.</div><div class="ttdef"><b>Definition:</b> pio.h:1139</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga0e60c768ea29f296b5ef40c02211bbccaacce0dbc391b9bb05965b7bc1b6f7698"><div class="ttname"><a href="group__hardware__pio.html#gga0e60c768ea29f296b5ef40c02211bbccaacce0dbc391b9bb05965b7bc1b6f7698">pis_sm3_rx_fifo_not_empty</a></div><div class="ttdeci">@ pis_sm3_rx_fifo_not_empty</div><div class="ttdoc">State machine 3 RX FIFO is not empty.</div><div class="ttdef"><b>Definition:</b> pio.h:1142</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga7d415b966abbc1c25315d0775d093356a1ecaeaf5a3d81338a276b30f019b05c4"><div class="ttname"><a href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a1ecaeaf5a3d81338a276b30f019b05c4">PIO_FIFO_JOIN_NONE</a></div><div class="ttdeci">@ PIO_FIFO_JOIN_NONE</div><div class="ttdoc">TX FIFO length=4 is used for transmit, RX FIFO length=4 is used for receive.</div><div class="ttdef"><b>Definition:</b> pio.h:78</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga7d415b966abbc1c25315d0775d093356a22a2cbf467019804e134a38d40249f50"><div class="ttname"><a href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356a22a2cbf467019804e134a38d40249f50">PIO_FIFO_JOIN_TX</a></div><div class="ttdeci">@ PIO_FIFO_JOIN_TX</div><div class="ttdoc">TX FIFO length=8 is used for transmit, RX FIFO is disabled.</div><div class="ttdef"><b>Definition:</b> pio.h:79</div></div>
<div class="ttc" id="agroup__hardware__pio_html_gga7d415b966abbc1c25315d0775d093356ab2cff7409baac4928fec469fe5b44ed0"><div class="ttname"><a href="group__hardware__pio.html#gga7d415b966abbc1c25315d0775d093356ab2cff7409baac4928fec469fe5b44ed0">PIO_FIFO_JOIN_RX</a></div><div class="ttdeci">@ PIO_FIFO_JOIN_RX</div><div class="ttdoc">RX FIFO length=8 is used for receive, TX FIFO is disabled.</div><div class="ttdef"><b>Definition:</b> pio.h:80</div></div>
<div class="ttc" id="agroup__pico__base_html_ggaddcb20bc9a61ceff479aa87369a862aaa9b50bcb755cf2e8295de9ffa52b252fd"><div class="ttname"><a href="group__pico__base.html#ggaddcb20bc9a61ceff479aa87369a862aaa9b50bcb755cf2e8295de9ffa52b252fd">PICO_OK</a></div><div class="ttdeci">@ PICO_OK</div><div class="ttdoc">No error; the operation succeeded.</div><div class="ttdef"><b>Definition:</b> error.h:23</div></div>
<div class="ttc" id="agroup__pico__base_html_ggaddcb20bc9a61ceff479aa87369a862aaac86a6335326022a1ff4d1cd8aad4bb69"><div class="ttname"><a href="group__pico__base.html#ggaddcb20bc9a61ceff479aa87369a862aaac86a6335326022a1ff4d1cd8aad4bb69">PICO_ERROR_BAD_ALIGNMENT</a></div><div class="ttdeci">@ PICO_ERROR_BAD_ALIGNMENT</div><div class="ttdoc">Address was mis-aligned (usually not on word boundary)</div><div class="ttdef"><b>Definition:</b> error.h:35</div></div>
<div class="ttc" id="agroup__pico__platform_html_gab0d1ba75ceb64131e19f613d7a5313c9"><div class="ttname"><a href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a></div><div class="ttdeci">static __force_inline void tight_loop_contents(void)</div><div class="ttdoc">No-op function for the body of tight loops.</div><div class="ttdef"><b>Definition:</b> platform.h:67</div></div>
<div class="ttc" id="agroup__sm__config_html_ga1dbca28933c083592e6e359effe250bf"><div class="ttname"><a href="group__sm__config.html#ga1dbca28933c083592e6e359effe250bf">sm_config_set_out_pin_base</a></div><div class="ttdeci">static void sm_config_set_out_pin_base(pio_sm_config *c, uint out_base)</div><div class="ttdoc">Set the base of the 'out' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:271</div></div>
<div class="ttc" id="agroup__sm__config_html_ga365abc6d25301810ca5ee11e5b36c763"><div class="ttname"><a href="group__sm__config.html#ga365abc6d25301810ca5ee11e5b36c763">sm_config_set_clkdiv_int_frac</a></div><div class="ttdeci">static void sm_config_set_clkdiv_int_frac(pio_sm_config *c, uint16_t div_int, uint8_t div_frac)</div><div class="ttdoc">Set the state machine clock divider (from integer and fractional parts - 16:8) in a state machine con...</div><div class="ttdef"><b>Definition:</b> pio.h:461</div></div>
<div class="ttc" id="agroup__sm__config_html_ga40d4807c0665d30ceab153b7444560eb"><div class="ttname"><a href="group__sm__config.html#ga40d4807c0665d30ceab153b7444560eb">sm_config_set_set_pin_base</a></div><div class="ttdeci">static void sm_config_set_set_pin_base(pio_sm_config *c, uint set_base)</div><div class="ttdoc">Set the base of the 'set' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:317</div></div>
<div class="ttc" id="agroup__sm__config_html_ga613bed03e10e569f1b7aede74d40a5b5"><div class="ttname"><a href="group__sm__config.html#ga613bed03e10e569f1b7aede74d40a5b5">sm_config_set_out_shift</a></div><div class="ttdeci">static void sm_config_set_out_shift(pio_sm_config *c, bool shift_right, bool autopull, uint pull_threshold)</div><div class="ttdoc">Setup 'out' shifting parameters in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:559</div></div>
<div class="ttc" id="agroup__sm__config_html_ga78e129fe383f2af0fc5e1448dea4c3d6"><div class="ttname"><a href="group__sm__config.html#ga78e129fe383f2af0fc5e1448dea4c3d6">sm_config_set_set_pin_count</a></div><div class="ttdeci">static void sm_config_set_set_pin_count(pio_sm_config *c, uint set_count)</div><div class="ttdoc">Set the count of 'set' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:335</div></div>
<div class="ttc" id="agroup__sm__config_html_ga7abfda1f60c62565d5b13536b0605af7"><div class="ttname"><a href="group__sm__config.html#ga7abfda1f60c62565d5b13536b0605af7">sm_config_set_sideset_pin_base</a></div><div class="ttdeci">static void sm_config_set_sideset_pin_base(pio_sm_config *c, uint sideset_base)</div><div class="ttdoc">Set the base of the 'sideset' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:405</div></div>
<div class="ttc" id="agroup__sm__config_html_ga8a9141ceadf9e735b1e96457865de3f6"><div class="ttname"><a href="group__sm__config.html#ga8a9141ceadf9e735b1e96457865de3f6">sm_config_set_out_special</a></div><div class="ttdeci">static void sm_config_set_out_special(pio_sm_config *c, bool sticky, bool has_enable_pin, uint enable_pin_index)</div><div class="ttdoc">Set special 'out' operations in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:601</div></div>
<div class="ttc" id="agroup__sm__config_html_gaaf804a05a2ebaa127d0d216b3d4e3e80"><div class="ttname"><a href="group__sm__config.html#gaaf804a05a2ebaa127d0d216b3d4e3e80">sm_config_set_in_pin_base</a></div><div class="ttdeci">static void sm_config_set_in_pin_base(pio_sm_config *c, uint in_base)</div><div class="ttdoc">Set the base of the 'in' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:363</div></div>
<div class="ttc" id="agroup__sm__config_html_gac418400e30520ea3961d8977c180a4f9"><div class="ttname"><a href="group__sm__config.html#gac418400e30520ea3961d8977c180a4f9">sm_config_set_in_pins</a></div><div class="ttdeci">static void sm_config_set_in_pins(pio_sm_config *c, uint in_base)</div><div class="ttdoc">Set the base fpr the 'in' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:381</div></div>
<div class="ttc" id="agroup__sm__config_html_gacd24870944ce2f00f3f7847bb3e5d543"><div class="ttname"><a href="group__sm__config.html#gacd24870944ce2f00f3f7847bb3e5d543">sm_config_set_mov_status</a></div><div class="ttdeci">static void sm_config_set_mov_status(pio_sm_config *c, enum pio_mov_status_type status_sel, uint status_n)</div><div class="ttdoc">Set source for 'mov status' in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:617</div></div>
<div class="ttc" id="agroup__sm__config_html_gad55bf8b410fa1d13bd1bd020587e01d7"><div class="ttname"><a href="group__sm__config.html#gad55bf8b410fa1d13bd1bd020587e01d7">sm_config_set_sideset_pins</a></div><div class="ttdeci">static void sm_config_set_sideset_pins(pio_sm_config *c, uint sideset_base)</div><div class="ttdoc">Set the 'sideset' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:426</div></div>
<div class="ttc" id="agroup__sm__config_html_gada1dff2c00b7d3a1cf722880c8373424"><div class="ttname"><a href="group__sm__config.html#gada1dff2c00b7d3a1cf722880c8373424">sm_config_set_set_pins</a></div><div class="ttdeci">static void sm_config_set_set_pins(pio_sm_config *c, uint set_base, uint set_count)</div><div class="ttdoc">Set the 'set' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:350</div></div>
<div class="ttc" id="agroup__sm__config_html_gade3d072e319fc7d10bec180a9692ea89"><div class="ttname"><a href="group__sm__config.html#gade3d072e319fc7d10bec180a9692ea89">sm_config_set_out_pin_count</a></div><div class="ttdeci">static void sm_config_set_out_pin_count(pio_sm_config *c, uint out_count)</div><div class="ttdoc">Set the number of 'out' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:289</div></div>
<div class="ttc" id="agroup__sm__config_html_gae8c09c7a4372da95ad777faae51c5a24"><div class="ttname"><a href="group__sm__config.html#gae8c09c7a4372da95ad777faae51c5a24">sm_config_set_clkdiv</a></div><div class="ttdeci">static void sm_config_set_clkdiv(pio_sm_config *c, float div)</div><div class="ttdoc">Set the state machine clock divider (from a floating point value) in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:493</div></div>
<div class="ttc" id="agroup__sm__config_html_gaed7a6e7dc4f1979c7c62e4773df8c79b"><div class="ttname"><a href="group__sm__config.html#gaed7a6e7dc4f1979c7c62e4773df8c79b">sm_config_set_in_shift</a></div><div class="ttdeci">static void sm_config_set_in_shift(pio_sm_config *c, bool shift_right, bool autopush, uint push_threshold)</div><div class="ttdoc">Setup 'in' shifting parameters in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:540</div></div>
<div class="ttc" id="agroup__sm__config_html_gaf2bfc66d6427ff92519e38dcb611133b"><div class="ttname"><a href="group__sm__config.html#gaf2bfc66d6427ff92519e38dcb611133b">sm_config_set_jmp_pin</a></div><div class="ttdeci">static void sm_config_set_jmp_pin(pio_sm_config *c, uint pin)</div><div class="ttdoc">Set the 'jmp' pin in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:522</div></div>
<div class="ttc" id="agroup__sm__config_html_gaf2d2a23b08ba74188160469b3fd09936"><div class="ttname"><a href="group__sm__config.html#gaf2d2a23b08ba74188160469b3fd09936">pio_get_default_sm_config</a></div><div class="ttdeci">static pio_sm_config pio_get_default_sm_config(void)</div><div class="ttdoc">Get the default state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:649</div></div>
<div class="ttc" id="agroup__sm__config_html_gaf3004bbd996443d0c841664ebc92905c"><div class="ttname"><a href="group__sm__config.html#gaf3004bbd996443d0c841664ebc92905c">sm_config_set_out_pins</a></div><div class="ttdeci">static void sm_config_set_out_pins(pio_sm_config *c, uint out_base, uint out_count)</div><div class="ttdoc">Set the 'out' pins in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:304</div></div>
<div class="ttc" id="agroup__sm__config_html_gaf543422206a8dbdc2efea85818dd650e"><div class="ttname"><a href="group__sm__config.html#gaf543422206a8dbdc2efea85818dd650e">sm_config_set_sideset</a></div><div class="ttdeci">static void sm_config_set_sideset(pio_sm_config *c, uint bit_count, bool optional, bool pindirs)</div><div class="ttdoc">Set the 'sideset' options in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:438</div></div>
<div class="ttc" id="agroup__sm__config_html_gafb753e8b35bbea9209ca4399a845f89c"><div class="ttname"><a href="group__sm__config.html#gafb753e8b35bbea9209ca4399a845f89c">sm_config_set_wrap</a></div><div class="ttdeci">static void sm_config_set_wrap(pio_sm_config *c, uint wrap_target, uint wrap)</div><div class="ttdoc">Set the wrap addresses in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:508</div></div>
<div class="ttc" id="agroup__sm__config_html_gafea1a06362182514518ebd91b2d52fd5"><div class="ttname"><a href="group__sm__config.html#gafea1a06362182514518ebd91b2d52fd5">sm_config_set_fifo_join</a></div><div class="ttdeci">static void sm_config_set_fifo_join(pio_sm_config *c, enum pio_fifo_join join)</div><div class="ttdoc">Setup the FIFO joining in a state machine configuration.</div><div class="ttdef"><b>Definition:</b> pio.h:576</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
<div class="ttc" id="astructpio__hw__t_html"><div class="ttname"><a href="structpio__hw__t.html">pio_hw_t</a></div><div class="ttdef"><b>Definition:</b> pio.h:132</div></div>
<div class="ttc" id="astructpio__program_html"><div class="ttname"><a href="structpio__program.html">pio_program</a></div><div class="ttdef"><b>Definition:</b> pio.h:778</div></div>
<div class="ttc" id="astructpio__sm__config_html"><div class="ttname"><a href="structpio__sm__config.html">pio_sm_config</a></div><div class="ttdoc">PIO Configuration structure.</div><div class="ttdef"><b>Definition:</b> pio.h:217</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>